public static void Stop(ref LateTween t) { if (t != null) { t.DoStop(); t = null; } }
public static LateTween Create(GameObject go) { if (!go) { go = GameEngine.instance.gameObject; } LateTween t = go.AddComponent <LateTween>(); t._go = go; return(t); }
/// <summary> /// 每隔interval秒调用一次func /// </summary> /// <param name="go"></param> /// <param name="func"></param> /// <param name="interval">时间间隔</param> /// <param name="count">总共调用次数,默认无限</param> /// <returns></returns> public static LateTween Schedule(GameObject go, System.Action func, float interval, int count = int.MaxValue) { return(LateTween.Create(go).Delay(interval).Func(func).Sequence(2).Repeat(count).Do()); }
/// <summary> /// 每帧调用 /// </summary> /// <param name="go"></param> /// <param name="func"></param> /// <returns></returns> public static LateTween Tick(GameObject go, System.Action func) { return(LateTween.Create(go).Tick(func).Do()); }
/// <summary> /// 延时调用 /// </summary> /// <param name="go"></param> /// <param name="func"></param> /// <param name="s"></param> /// <returns></returns> public static LateTween Delay(GameObject go, System.Action func, float s, bool scaled = false) { return(LateTween.Create(go).UseScaleTime(scaled).Delay(s).Func(func).Do()); }