AnimatedColor.cs 374 B

12345678910111213141516171819202122
  1. using System;
  2. using UnityEngine;
  3. [ExecuteInEditMode]
  4. [RequireComponent(typeof(UIWidget))]
  5. public class AnimatedColor : MonoBehaviour
  6. {
  7. private void OnEnable()
  8. {
  9. this.mWidget = base.GetComponent<UIWidget>();
  10. this.LateUpdate();
  11. }
  12. private void LateUpdate()
  13. {
  14. this.mWidget.color = this.color;
  15. }
  16. public Color color = Color.white;
  17. private UIWidget mWidget;
  18. }