private static int DOFade(ILuaState lua) { GameObject go = lua.ToGameObject(1); var group = lua.ToEnumValue(2, typeof(FadeGroup)); var func = lua.ToLuaFunction(3); bool reset = lua.OptBoolean(4, false); if (go) { ZTween.Stop(go); var tw = group != null?FadeTool.DOFade(go, (FadeGroup)group, reset) : FadeTool.DOFade(go, reset); if (func != null) { if (tw != null) { tw.CompleteWith((o) => { func.Invoke(go); func.Dispose(); }); } else { LuaScriptMgr.Instance.StartCoroutine(LibUnity.LuaInvoke(func, null, go)); } } } return(0); }
private static int CompleteTween(ILuaState lua) { var go = lua.ToGameObject(1); if (go) { var tweens = go.GetComponents(typeof(ITweenable)); for (int i = 0; i < tweens.Length; ++i) { ZTween.Stop(tweens[i], true); } } return(0); }
public void TweenColor(Color to) { ZTween.Stop(this); ZTween.Tween(GetColor, SetColor, to, 0.2f).SetTag(this); }