AlphaAnim.cs 406 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class AlphaAnim : MonoBehaviour
  6. {
  7. private RawImage sprite;
  8. void Start ()
  9. {
  10. sprite = GetComponent<RawImage>();
  11. }
  12. // Update is called once per frame
  13. void Update () {
  14. sprite.color = new Color(sprite.color.r, sprite.color.g, sprite.color.b, Mathf.PingPong(Time.time, 1f));
  15. }
  16. }