예제 #1
0
 private void OnEnable()
 {
     current    = (DoTweenAnimation)target;
     data       = current.GetData();
     laseChoose = data.anis;
     Init();
 }
예제 #2
0
 public DoTweenAnimationData GetData()
 {
     if (data == null)
     {
         data = new DoTweenAnimationData();
     }
     return(data);
 }
 static int SetData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameFramework.DoTweenAnimation     obj  = (GameFramework.DoTweenAnimation)ToLua.CheckObject <GameFramework.DoTweenAnimation>(L, 1);
         GameFramework.DoTweenAnimationData arg0 = (GameFramework.DoTweenAnimationData)ToLua.CheckObject <GameFramework.DoTweenAnimationData>(L, 2);
         obj.SetData(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameFramework.DoTweenAnimation     obj = (GameFramework.DoTweenAnimation)ToLua.CheckObject <GameFramework.DoTweenAnimation>(L, 1);
         GameFramework.DoTweenAnimationData o   = obj.GetData();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #5
0
 public void SetData(DoTweenAnimationData _data)
 {
     data = _data;
 }
예제 #6
0
        public override void OnInspectorGUI()
        {
            EditorGUILayout.Space();
            data.openEditor = EditorGUILayout.Toggle("编辑", data.openEditor);
            if (!data.openEditor)
            {
                return;
            }
            data.anis        = (DoTweenAnis)EditorGUILayout.EnumPopup("动画类型", data.anis);
            data.autoPlayer  = EditorGUILayout.Toggle("打开物体时自动播放", data.autoPlayer);
            data.autoDestroy = EditorGUILayout.Toggle("完成时自动销毁", data.autoDestroy);
            if (!data.autoDestroy)
            {
                data.autoClose   = EditorGUILayout.Toggle("完成时隐藏物体", data.autoClose);
                data.autoDisable = EditorGUILayout.Toggle("完成时关闭组件", data.autoDisable);
            }
            if (laseChoose != data.anis)
            {
                data.alreadySetStart = false;
                data.alreadySetEnd   = false;
                laseChoose           = data.anis;
            }

            GUILayout.Space(20);
            switch (data.anis)
            {
            case DoTweenAnis.ToMove:
            case DoTweenAnis.ToLocalMove:
            case DoTweenAnis.ToEulerAngles:
            case DoTweenAnis.ToLocalEulerAngles:
            case DoTweenAnis.ToScale:
            case DoTweenAnis.ToMoveUGUI:
                ToVector3();
                break;

            case DoTweenAnis.ToUGUIScale:
                ToVector2();
                break;

            case DoTweenAnis.ToUGUIShowInt:
            case DoTweenAnis.ToUGUIShowNumber:
            case DoTweenAnis.ToAlpha:
            case DoTweenAnis.ToFilledImage:
                ToNumber();
                break;

            case DoTweenAnis.ToUGUIColor:
                ToColor();
                break;

            default:
                return;
            }

            EditorGUILayout.Space();
            data.ease  = (Ease)EditorGUILayout.EnumPopup("Tween动画模式", data.ease);
            data.loop  = (DoTweenAnisLoop)EditorGUILayout.EnumPopup("循环模式", data.loop);
            data.time  = EditorGUILayout.FloatField("时长", data.time);
            data.delay = EditorGUILayout.FloatField("延时", data.delay);

            GUILayout.Space(20);
            EditorGUILayout.BeginHorizontal();
            {
                if (GUILayout.Button("保存", GUILayout.Width(150)))
                {
                    current.SetData(data);
                    data.openEditor = false;
                    Init();
                }
                if (GUILayout.Button("清除", GUILayout.Width(150)))
                {
                    current.SetData(null);
                    data = current.GetData();
                    Init();
                }
            }
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(20);
        }