示例#1
0
    protected void DrawCommonProperties()
    {
        Tweener tw = target as Tweener;

        if (NGUIEditorTools.DrawHeader("Tweener"))
        {
            NGUIEditorTools.BeginContents();
            NGUIEditorTools.SetLabelWidth(110f);

            GUI.changed = false;

            Tweener.Style  style = (Tweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.style);
            AnimationCurve curve = EditorGUILayout.CurveField("Animation Curve", tw.animationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
            //UITweener.Method method = (UITweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.method);

            GUILayout.BeginHorizontal();
            float dur = EditorGUILayout.FloatField("Duration", tw.duration, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            float del = EditorGUILayout.FloatField("Start Delay", tw.delay, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();

            int  tg = EditorGUILayout.IntField("Tween Group", tw.tweenGroup, GUILayout.Width(170f));
            bool ts = EditorGUILayout.Toggle("Ignore TimeScale", tw.ignoreTimeScale);

            if (GUI.changed)
            {
                NGUIEditorTools.RegisterUndo("Tween Change", tw);
                tw.animationCurve = curve;
                //tw.method = method;
                tw.style           = style;
                tw.ignoreTimeScale = ts;
                tw.tweenGroup      = tg;
                tw.duration        = dur;
                tw.delay           = del;
                NGUITools.SetDirty(tw);
            }
            NGUIEditorTools.EndContents();
        }

        NGUIEditorTools.SetLabelWidth(80f);
        NGUIEditorTools.DrawEvents("On Finished", tw, tw.onFinished);
    }
示例#2
0
        protected void DrawCommonProperties()
        {
            Tweener tw = target as Tweener;

            if (EditorTools.DrawHeader("Tweener"))
            {
                EditorTools.BeginContents();
                EditorTools.SetLabelWidth(110f);

                GUI.changed = false;

                Tweener.Style  style  = (Tweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.PlayStyle);
                AnimationCurve curve  = EditorGUILayout.CurveField("ExplotionAnimator Curve", tw.PlayAnimationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
                Tweener.Method method = (Tweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.PlayMethod);

                GUILayout.BeginHorizontal();
                float dur = EditorGUILayout.FloatField("Duration", tw.Duration, GUILayout.Width(170f));
                GUILayout.Label("seconds");
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                float del = EditorGUILayout.FloatField("Start Delay", tw.Delay, GUILayout.Width(170f));
                GUILayout.Label("seconds");
                GUILayout.EndHorizontal();

                if (GUI.changed)
                {
                    EditorTools.RegisterUndo("Tween Change", tw);
                    tw.PlayAnimationCurve = curve;
                    tw.PlayMethod         = method;
                    tw.PlayStyle          = style;
                    tw.Duration           = dur;
                    tw.Delay = del;
                }
                EditorTools.EndContents();
            }

            //EditorTools.SetLabelWidth(80f);
            //EditorTools.DrawEvents("On Finished", tw, tw.onFinished);
        }
示例#3
0
    protected void DrawCommonProperties()
    {
        Tweener tw = target as Tweener;

        if (UIEditorTools.DrawHeader("Tweener"))
        {
            UIEditorTools.BeginContents();
            UIEditorTools.SetLabelWidth(110f);

            GUI.changed = false;

            Tweener.Style  style = (Tweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.m_Style);
            AnimationCurve curve = EditorGUILayout.CurveField("Animation Curve", tw.m_AnimationCurve,
                                                              GUILayout.Width(170), GUILayout.Height(62));

            GUILayout.BeginHorizontal();
            float dur = EditorGUILayout.FloatField("Duration", tw.Duration, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();


            if (GUI.changed == true)
            {
                UIEditorTools.RegisterUndo("Tween Change", tw);

                tw.m_AnimationCurve = curve;
                tw.m_Style          = style;
                tw.Duration         = dur;

                UnityEditor.EditorUtility.SetDirty(tw);
            }

            UIEditorTools.EndContents();
        }

        UIEditorTools.SetLabelWidth(80f);
        UIEditorTools.DrawEvents("On Finished", tw, tw.onFinished);
    }