示例#1
0
        public static void PlayTween(GameObject go, bool isForward, LuaFunction luafunc, bool isRestart)
        {
            if (go == null)
            {
                return;
            }
            UIPlayTween component = go.GetComponent <UIPlayTween>();

            if (component != null)
            {
                component.SetOnFinished(delegate
                {
                    if (luafunc != null)
                    {
                        luafunc.Call();
                        luafunc.Dispose();
                        luafunc = null;
                    }
                });
                component.Play(isForward);
            }
            else
            {
                UITweener component2 = go.GetComponent <UITweener>();
                if (component2 != null)
                {
                    component2.SetOnFinished(delegate
                    {
                        if (luafunc != null)
                        {
                            luafunc.Call();
                            luafunc.Dispose();
                            luafunc = null;
                        }
                    });
                    if (isRestart)
                    {
                        component2.ResetToBeginning();
                    }
                    component2.Play(isForward);
                }
                else if (luafunc != null)
                {
                    luafunc.Call();
                    luafunc.Dispose();
                    luafunc = null;
                }
            }
        }
示例#2
0
        public static void PlayGroupTween(GameObject go, int tweenGroup, bool isForward, LuaFunction luafunc)
        {
            if (go == null)
            {
                return;
            }
            UIPlayTween component = go.GetComponent <UIPlayTween>();

            if (component != null)
            {
                component.tweenGroup = tweenGroup;
                if (luafunc != null)
                {
                    component.SetOnFinished(delegate
                    {
                        luafunc.Call();
                        luafunc.Dispose();
                        luafunc = null;
                    });
                }
                component.Play(isForward);
            }
        }