using Assets.Scripts; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class LoadingAnimation : MonoBehaviour { // Start is called before the first frame update [SerializeField] Color c; void Start() { Refresh(); } // Update is called once per frame void Update() { } void OnRectTransformDimensionsChange() { Refresh(); } private void OnValidate() { Refresh(); } void Refresh() { Transform L = transform.Find("L"), R = transform.Find("R"); if (L && R && c.a!=0) { transform.Find("L").GetComponent().color = c; transform.Find("R").GetComponent().color = c; } } }