CUI_AnimateCurvedFillOnStart.cs 821 B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.UI;
  4. namespace CurvedUI
  5. {
  6. public class CUI_AnimateCurvedFillOnStart : MonoBehaviour
  7. {
  8. // Update is called once per frame
  9. void Update()
  10. {
  11. CurvedUISettings set = this.GetComponent<CurvedUISettings>();
  12. Text textie = this.GetComponentInChildren<Text>();
  13. if (Time.time < 1.5f)
  14. {
  15. set.RingFill = Mathf.PerlinNoise(Time.time * 30.23234f, Time.time * 30.2313f) * 0.15f;
  16. textie.text = "Accesing Mainframe...";
  17. }
  18. else if (Time.time < 2.5f)
  19. {
  20. set.RingFill = Mathf.Clamp(set.RingFill + Time.deltaTime * 3, 0, 1);
  21. textie.text = "Mainframe Active";
  22. }
  23. }
  24. }
  25. }