Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using DG.Tweening;
- using UnityEngine;
- using UnityEngine.UI;
- [ExecuteAlways]
- public class RedlabsUIEffect_Color : RedlabsUIEffect_Base
- {
- [SerializeField] Graphic graphic;
- [SerializeField] Color activateColor = Color.white;
- [SerializeField] Color deactivateColor = Color.white;
- void Awake()
- {
- if(!graphic)
- {
- graphic = GetComponent<Graphic>();
- deactivateColor = graphic.color;
- }
- }
- public override void OnActivate()
- {
- graphic.DOColor(activateColor, 0.3f);
- }
- public override void OnDeactivate()
- {
- graphic.DOColor(deactivateColor, 0.3f);
- }
- }
Add Comment
Please, Sign In to add comment