12345678910111213141516 |
- using UnityEngine;
- using System.Collections;
- using System;
- public static class UIWidgetExtensions
- {
- public static void FadeTo(this UIWidget widget, float newAlpha, float time = 1, float delay = 0, Action onComplete = null, MyTween.Loop loopType = MyTween.Loop.none, int numOfLoops = 0)
- {
- widget.ValueTo(widget.alpha, newAlpha, time, widget.OnUpdate, delay, MyTween.Ease.linear, onComplete, loopType, numOfLoops);
- }
- static void OnUpdate(this UIWidget widget, float newAlpha)
- {
- widget.alpha = newAlpha;
- }
- }
|