AlphaAnim.cs 807 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class AlphaAnim : MonoBehaviour
  5. {
  6. private UISprite sprite;
  7. void Start ()
  8. {
  9. sprite = GetComponent<UISprite>();
  10. }
  11. // Update is called once per frame
  12. void Update () {
  13. Debug.Log(TimeManager.Instance.timecurrent.Day +" " + TimeManager.Instance.timecurrent.Month +" " +TimeManager.Instance.timecurrent.Year);
  14. if (TimeManager.Instance.timecurrent.Year >=17) {
  15. if (TimeManager.Instance.timecurrent.Month >= 10)
  16. {
  17. if (TimeManager.Instance.timecurrent.Day > 11) {
  18. sprite.color = new Color (sprite.color.r, sprite.color.g, sprite.color.b, 1);
  19. return;
  20. }
  21. }
  22. }
  23. sprite.color = new Color (sprite.color.r, sprite.color.g, sprite.color.b, Mathf.PingPong (Time.time, 1f));
  24. }
  25. }