protected void DrawCommonProperties()
        {
            if (InspectorToolExtends.DrawHeader("Tweener"))
            {
                InspectorToolExtends.BeginContents();
                EditorGUIUtility.labelWidth = 110f;

                EditorGUI.BeginChangeCheck();

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

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

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

                bool ts = EditorGUILayout.Toggle("Ignore TimeScale", mTarget.ignoreTimeScale);

                if (EditorGUI.EndChangeCheck())
                {
                    InspectorToolExtends.RegisterUndo("Tween Change", mTarget);
                    mTarget.animationCurve  = curve;
                    mTarget.method          = moveType;
                    mTarget.style           = style;
                    mTarget.ignoreTimeScale = ts;
                    mTarget.duration        = dur;
                    mTarget.delay           = del;
                    InspectorToolExtends.SetDirty(mTarget);
                }
                InspectorToolExtends.EndContents();
            }
        }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            GUILayout.Space(6f);
            EditorGUIUtility.labelWidth = 120f;

            EditorGUI.BeginChangeCheck();

            Vector3 from = EditorGUILayout.Vector3Field("From", mTarget.from);
            Vector3 to   = EditorGUILayout.Vector3Field("To", mTarget.to);

            if (EditorGUI.EndChangeCheck())
            {
                InspectorToolExtends.RegisterUndo("Tween Change", mTarget);
                mTarget.from = from;
                mTarget.to   = to;
                InspectorToolExtends.SetDirty(mTarget);
            }

            DrawCommonProperties();
        }
        public override void OnInspectorGUI()
        {
            GUILayout.Space(6f);
            EditorGUIUtility.labelWidth = 120f;

            EditorGUI.BeginChangeCheck();

            float from = EditorGUILayout.FloatField("From", mTarget.from);
            float to   = EditorGUILayout.FloatField("To", mTarget.to);

            //bool isIncludeAll = EditorGUILayout.Toggle("isIncludeAll", mTarget.isIncludeAll);

            if (EditorGUI.EndChangeCheck())
            {
                InspectorToolExtends.RegisterUndo("Tween Change", mTarget);
                mTarget.from = from;
                mTarget.to   = to;
                //mTarget.isIncludeAll = isIncludeAll;
                InspectorToolExtends.SetDirty(mTarget);
            }

            DrawCommonProperties();
        }
        public override void OnInspectorGUI()
        {
            GUILayout.Space(6f);
            EditorGUIUtility.labelWidth = 120f;

            EditorGUI.BeginChangeCheck();

            Color  from         = EditorGUILayout.ColorField("From", mTarget.from);
            Color  to           = EditorGUILayout.ColorField("To", mTarget.to);
            string nameColor    = EditorGUILayout.TextField("nameColor", mTarget.nameColor);
            bool   isIncludeAll = EditorGUILayout.Toggle("isIncludeAll", mTarget.isIncludeAll);

            if (EditorGUI.EndChangeCheck())
            {
                InspectorToolExtends.RegisterUndo("Tween Change", mTarget);
                mTarget.from         = from;
                mTarget.to           = to;
                mTarget.isIncludeAll = isIncludeAll;
                mTarget.nameColor    = nameColor;
                InspectorToolExtends.SetDirty(mTarget);
            }

            DrawCommonProperties();
        }