protected void DrawCommonProperties()
        {
            UITweener tw = target as UITweener;

            if (TweenKitEditorTools.DrawHeader("Tweener"))
            {
                TweenKitEditorTools.BeginContents();
                TweenKitEditorTools.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);
                bool fx = EditorGUILayout.Toggle("Use Fixed Update", tw.useFixedUpdate);

                if (GUI.changed)
                {
                    TweenKitEditorTools.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;
                    tw.useFixedUpdate  = fx;
                    TweenKitTools.SetDirty(tw);
                }
                TweenKitEditorTools.EndContents();
            }

            TweenKitEditorTools.SetLabelWidth(80f);
            TweenKitEditorTools.DrawEvents("On Finished", tw, tw.onFinished);
        }
Exemple #2
0
        /// <summary>
        /// Draw a list of fields for the specified list of delegates.
        /// </summary>

        public static void DrawEvents(string text, Object undoObject, List <EventDelegate> list, string noTarget, string notValid, bool minimalistic)
        {
            if (!TweenKitEditorTools.DrawHeader(text, text, false, minimalistic))
            {
                return;
            }

            if (!minimalistic)
            {
                TweenKitEditorTools.BeginContents(minimalistic);
                GUILayout.BeginHorizontal();
                GUILayout.BeginVertical();

                EventDelegateEditor.Field(undoObject, list, notValid, notValid, minimalistic);

                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
                TweenKitEditorTools.EndContents();
            }
            else
            {
                EventDelegateEditor.Field(undoObject, list, notValid, notValid, minimalistic);
            }
        }