Ejemplo n.º 1
0
    protected void DrawCommonProperties()
    {
        UITweener tw = target as UITweener;

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

            GUI.changed = false;

            UITweener.Style style = (UITweener.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)
            {
                UGUIEditorTools.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;
                UGUIEditorTools.SetDirty(tw);
            }
            UGUIEditorTools.EndContents();
        }

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