PatchBackground.cs 486 B

123456789101112131415161718192021
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class PatchBackground : MonoBehaviour
  6. {
  7. [SerializeField] bool _isLauncher = false;
  8. async void Start()
  9. {
  10. Image image = GetComponent<Image>();
  11. if (image == null)
  12. {
  13. return;
  14. }
  15. Sprite sprite = await StreamingAssetsUtility.GetSprite("Background_home", isLauncher: _isLauncher);
  16. image.sprite = sprite;
  17. }
  18. }