Ejemplo n.º 1
0
        public virtual bool DoDrawTimeScaleAndAutoKill()
        {
            if (!IsAnimationOpen)
            {
                return(false);
            }

            EditorGUILayout.BeginHorizontal();
            var timeScaleProperty  = TweenParamProperty.FindProperty(TweenKey.TimeScale);
            var timeSmoothProperty = TweenParamProperty.FindProperty(TweenKey.TimeSmooth);

            if (timeScaleProperty.boolValue)
            {
                EditorGUILayout.PropertyField(timeScaleProperty);
                EditorGUILayout.PropertyField(timeSmoothProperty);
            }
            else
            {
                EditorGUILayout.PropertyField(timeScaleProperty, GUILayout.Width(PropertyWidth));
                timeSmoothProperty.boolValue = false;
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            var selfScaleProperty = TweenParamProperty.FindProperty(TweenKey.SelfScale);

            EditorGUILayout.PropertyField(selfScaleProperty, GUILayout.Width(PropertyWidth));
            var autoKillProperty = TweenParamProperty.FindProperty(TweenKey.AutoKill);

            EditorGUILayout.PropertyField(autoKillProperty, GUILayout.Width(PropertyWidth));
            EditorGUILayout.EndHorizontal();

            return(true);
        }
Ejemplo n.º 2
0
        public virtual bool DoDrawPlayType()
        {
            if (!IsAnimationOpen)
            {
                return(false);
            }

            EditorGUILayout.BeginHorizontal();
            var playTypeProperty = TweenParamProperty.FindProperty(TweenKey.PlayType);

            EditorGUILayout.PropertyField(playTypeProperty);
            var easeTypeProperty = TweenParamProperty.FindProperty(TweenKey.EaseType);

            EditorGUILayout.PropertyField(easeTypeProperty);
            EditorGUILayout.EndHorizontal();

            // 指定播放模式下,需要显示播放次数
            var playType = (PlayType)Enum.Parse(typeof(PlayType), Enum.GetNames(typeof(PlayType))[playTypeProperty.enumValueIndex]);

            if (playType == PlayType.LoopCount || playType == PlayType.PingPongCount)
            {
                EditorGUILayout.BeginHorizontal();
                var loopCountProperty = TweenParamProperty.FindProperty(TweenKey.LoopCount);
                EditorGUILayout.PropertyField(loopCountProperty, GUILayout.Width(PropertyWidth));
                EditorGUILayout.EndHorizontal();
            }

            return(true);
        }
Ejemplo n.º 3
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            var fromProperty = TweenParamProperty.FindProperty(TweenKey.FromTransform);

            EditorGUILayout.PropertyField(fromProperty, new GUIContent("From"));
            var toProperty = TweenParamProperty.FindProperty(TweenKey.ToTransform);

            EditorGUILayout.PropertyField(toProperty, new GUIContent("To"));
        }
Ejemplo n.º 4
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            var queueProperty = TweenParamProperty.FindProperty(TweenKey.QueueColor);

            EditorGUILayout.PropertyField(queueProperty, true);
            var lerpModeProperty = TweenParamProperty.FindProperty(TweenKey.ColorLerpMode);

            EditorGUILayout.PropertyField(lerpModeProperty, GUILayout.Width(PropertyWidth));
        }
Ejemplo n.º 5
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            var queueProperty = TweenParamProperty.FindProperty(TweenKey.QueueVector3);

            EditorGUILayout.PropertyField(queueProperty, true);
            var pathModeProperty = TweenParamProperty.FindProperty(TweenKey.PathMode);

            EditorGUILayout.PropertyField(pathModeProperty, GUILayout.Width(PropertyWidth));
        }
Ejemplo n.º 6
0
        public virtual void DoDrawMaterialsInfo()
        {
            DrawHeader("Material", Color.white, Color.gray);
            GUILayout.BeginHorizontal();
            var resourceIndexProperty = TweenParamProperty.FindProperty(TweenKey.ResourcesIndex);

            resourceIndexProperty.intValue = EditorGUILayout.IntField("Index", resourceIndexProperty.intValue);
            var resourceKeyProperty = TweenParamProperty.FindProperty(TweenKey.ResourcesKey);

            resourceKeyProperty.stringValue = EditorGUILayout.TextField("Property", resourceKeyProperty.stringValue);
            GUILayout.EndHorizontal();
        }
Ejemplo n.º 7
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            // EditorGUILayout.BeginHorizontal();
            var fromProperty = TweenParamProperty.FindProperty(TweenKey.FromStr);

            fromProperty.stringValue = EditorGUILayout.TextField("From", fromProperty.stringValue);
            var toProperty = TweenParamProperty.FindProperty(TweenKey.ToStr);

            toProperty.stringValue = EditorGUILayout.TextField("To", toProperty.stringValue);
            // EditorGUILayout.EndHorizontal();
        }
Ejemplo n.º 8
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            EditorGUILayout.BeginVertical();
            var fromProperty = TweenParamProperty.FindProperty(TweenKey.FromQuaternion);

            EditorGUILayout.PropertyField(fromProperty, new GUIContent("From"), true);
            var toProperty = TweenParamProperty.FindProperty(TweenKey.ToQuaternion);

            EditorGUILayout.PropertyField(toProperty, new GUIContent("To"), true);
            EditorGUILayout.EndVertical();
        }
Ejemplo n.º 9
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            EditorGUILayout.BeginVertical();
            var fromProperty = TweenParamProperty.FindProperty(TweenKey.FromVector4);

            fromProperty.vector4Value = EditorGUILayout.Vector4Field("From", fromProperty.vector4Value);
            var toProperty = TweenParamProperty.FindProperty(TweenKey.ToVector4);

            toProperty.vector4Value = EditorGUILayout.Vector4Field("To", toProperty.vector4Value);
            EditorGUILayout.EndVertical();
        }
Ejemplo n.º 10
0
        public override void DoDrawValue()
        {
            base.DoDrawValue();
            EditorGUILayout.BeginHorizontal();
            var fromProperty = TweenParamProperty.FindProperty(TweenKey.FromFloat);

            fromProperty.floatValue = EditorGUILayout.FloatField("From", fromProperty.floatValue);
            var toProperty = TweenParamProperty.FindProperty(TweenKey.ToFloat);

            toProperty.floatValue = EditorGUILayout.FloatField("To", toProperty.floatValue);
            EditorGUILayout.EndHorizontal();
        }
Ejemplo n.º 11
0
        public override bool DoDrawAnimationAppend()
        {
            var visible = base.DoDrawAnimationAppend();

            if (!visible)
            {
                return(false);
            }
            var worldSpaceProperty = TweenParamProperty.FindProperty(TweenKey.WorldSpace);

            EditorGUILayout.PropertyField(worldSpaceProperty, GUILayout.Width(PropertyWidth));
            return(true);
        }
Ejemplo n.º 12
0
        public override bool DoDrawCallback()
        {
            base.DoDrawCallback();
            if (!IsCallbackOpen)
            {
                return(false);
            }

            var onValueProperty = TweenParamProperty.FindProperty(TweenKey.OnValueFloat);

            EditorGUILayout.PropertyField(onValueProperty);
            return(true);
        }
Ejemplo n.º 13
0
        public override void DoDrawValue()
        {
            DoDrawTweenHeader();
            EditorGUILayout.BeginHorizontal();
            var fromProperty = TweenParamProperty.FindProperty(TweenKey.FromColor);

            fromProperty.colorValue = EditorGUILayout.ColorField("From", fromProperty.colorValue);
            var toProperty = TweenParamProperty.FindProperty(TweenKey.ToColor);

            toProperty.colorValue = EditorGUILayout.ColorField("To", toProperty.colorValue);
            EditorGUILayout.EndHorizontal();
            var lerpModeProperty = TweenParamProperty.FindProperty(TweenKey.ColorLerpMode);

            EditorGUILayout.PropertyField(lerpModeProperty, GUILayout.Width(PropertyWidth));
        }
Ejemplo n.º 14
0
        public virtual bool DoDrawPlayMode()
        {
            if (!IsAnimationOpen)
            {
                return(false);
            }

            EditorGUILayout.BeginHorizontal();
            var autoPlayProperty = TweenParamProperty.FindProperty(TweenKey.AutoPlay);

            EditorGUILayout.PropertyField(autoPlayProperty);
            var updateTypeProperty = TweenParamProperty.FindProperty(TweenKey.UpdateType);

            EditorGUILayout.PropertyField(updateTypeProperty);
            EditorGUILayout.EndHorizontal();

            return(true);
        }
Ejemplo n.º 15
0
        public override void DoDrawShakeArgs()
        {
            // DrawHeader("Shake Args", Color.cyan, Color.black);
            var shakeProperty = TweenParamProperty.FindProperty(TweenKey.ShakeArgs);

            EditorGUILayout.PropertyField(shakeProperty, true);
//            EditorGUILayout.BeginHorizontal();
//            TweenComponent.ShakeArgs.ShakePos = EditorGUILayout.Toggle("Shake Pos", TweenComponent.ShakeArgs.ShakePos, GUILayout.Width(LabelWidth + 20));
//            TweenComponent.ShakeArgs.PowerPos = EditorGUILayout.Vector3Field("", TweenComponent.ShakeArgs.PowerPos);
//            EditorGUILayout.EndHorizontal();
//            EditorGUILayout.BeginHorizontal();
//            TweenComponent.ShakeArgs.ShakeRot = EditorGUILayout.Toggle("Shake Rot", TweenComponent.ShakeArgs.ShakeRot, GUILayout.Width(LabelWidth + 20));
//            TweenComponent.ShakeArgs.PowerRot = EditorGUILayout.Vector3Field("", TweenComponent.ShakeArgs.PowerRot);
//            EditorGUILayout.EndHorizontal();
//            EditorGUILayout.BeginHorizontal();
//            TweenComponent.ShakeArgs.ShakeScale = EditorGUILayout.Toggle("Shake Scale", TweenComponent.ShakeArgs.ShakeScale, GUILayout.Width(LabelWidth + 20));
//            TweenComponent.ShakeArgs.PowerScale = EditorGUILayout.Vector3Field("", TweenComponent.ShakeArgs.PowerScale);
//            EditorGUILayout.EndHorizontal();
//            TweenComponent.ShakeArgs.Count = EditorGUILayout.IntField("Shake Count", TweenComponent.ShakeArgs.Count);
        }
Ejemplo n.º 16
0
        public virtual bool DoDrawCallback()
        {
            if (Mode == TweenerEditorMode.Asset)
            {
                return(false);
            }
            IsCallbackOpen = DrawToggleHeader(IsCallbackOpen, "Callback", Color.white, Color.gray);
            if (!IsCallbackOpen)
            {
                return(false);
            }

            var onPlayProperty = TweenParamProperty.FindProperty(TweenKey.OnPlay);

            EditorGUILayout.PropertyField(onPlayProperty);
            var onStopProperty = TweenParamProperty.FindProperty(TweenKey.OnStop);

            EditorGUILayout.PropertyField(onStopProperty);
            return(true);
        }
Ejemplo n.º 17
0
        public virtual bool DoDrawDuration()
        {
            if (!IsAnimationOpen)
            {
                return(false);
            }

            EditorGUILayout.BeginHorizontal();
            var durationProperty = TweenParamProperty.FindProperty(TweenKey.Duration);

            EditorGUILayout.PropertyField(durationProperty);
            var startDelayProperty = TweenParamProperty.FindProperty(TweenKey.StartDelay);

            EditorGUILayout.PropertyField(startDelayProperty);
            EditorGUILayout.EndHorizontal();

            var playTypeProperty   = TweenParamProperty.FindProperty(TweenKey.PlayType);
            var playType           = (PlayType)Enum.Parse(typeof(PlayType), Enum.GetNames(typeof(PlayType))[playTypeProperty.enumValueIndex]);
            var needDrawInterval   = playType != PlayType.Once;
            var needDrawSpeedBased = Tweener?.SupportSpeedBased ?? true;

            if (needDrawInterval || needDrawSpeedBased)
            {
                EditorGUILayout.BeginHorizontal();
                if (needDrawInterval)
                {
                    var intervalProperty = TweenParamProperty.FindProperty(TweenKey.Interval);
                    EditorGUILayout.PropertyField(intervalProperty, GUILayout.Width(PropertyWidth));
                }

                if (needDrawSpeedBased)
                {
                    var speedBasedProperty = TweenParamProperty.FindProperty(TweenKey.SpeedBased);
                    EditorGUILayout.PropertyField(speedBasedProperty, GUILayout.Width(PropertyWidth));
                }
                EditorGUILayout.EndHorizontal();
            }

            return(true);
        }
Ejemplo n.º 18
0
        public virtual bool DoDrawCurve()
        {
            IsAnimationOpen = DrawToggleHeader(IsAnimationOpen, "Animation", Color.white, Color.gray);
            if (!IsAnimationOpen)
            {
                return(false);
            }

            GUILayout.BeginHorizontal();
            var curveTargetProperty = TweenParamProperty.FindProperty(TweenKey.CurveTarget);
            var curveModeProperty   = TweenParamProperty.FindProperty(TweenKey.CurveMode);

            if (RequireCurveCount > 1)
            {
                EditorGUILayout.PropertyField(curveTargetProperty);
                EditorGUILayout.PropertyField(curveModeProperty);
            }
            else
            {
                EditorGUILayout.PropertyField(curveTargetProperty, GUILayout.Width(PropertyWidth));
            }

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (RequireCurveCount == 1 || TweenParam.CurveMode == CurveMode.Single)
            {
                var curveProperty = TweenParamProperty.FindProperty(TweenKey.Curve);
                curveProperty.animationCurveValue = EditorGUILayout.CurveField("Curve", curveProperty.animationCurveValue, GUILayout.Width(EditorGUIUtility.labelWidth + CurveWidth), GUILayout.Height(CurveWidth));
            }

            if (RequireCurveCount == 2 && TweenParam.CurveMode == CurveMode.Independent)
            {
                var curveXProperty = TweenParamProperty.FindProperty(TweenKey.CurveX);
                curveXProperty.animationCurveValue = EditorGUILayout.CurveField("Curve XY", curveXProperty.animationCurveValue, GUILayout.Width(EditorGUIUtility.labelWidth + CurveWidth), GUILayout.Height(CurveWidth));
                var curveYProperty = TweenParamProperty.FindProperty(TweenKey.CurveY);
                curveYProperty.animationCurveValue = EditorGUILayout.CurveField("", curveYProperty.animationCurveValue, GUILayout.Width(CurveWidth), GUILayout.Height(CurveWidth));
            }

            if (RequireCurveCount == 3 && TweenParam.CurveMode == CurveMode.Independent)
            {
                var curveXProperty = TweenParamProperty.FindProperty(TweenKey.CurveX);
                curveXProperty.animationCurveValue = EditorGUILayout.CurveField("Curve XYZ", curveXProperty.animationCurveValue, GUILayout.Width(EditorGUIUtility.labelWidth + CurveWidth), GUILayout.Height(CurveWidth));
                var curveYProperty = TweenParamProperty.FindProperty(TweenKey.CurveY);
                curveYProperty.animationCurveValue = EditorGUILayout.CurveField("", curveYProperty.animationCurveValue, GUILayout.Width(CurveWidth), GUILayout.Height(CurveWidth));
                var curveZProperty = TweenParamProperty.FindProperty(TweenKey.CurveZ);
                curveZProperty.animationCurveValue = EditorGUILayout.CurveField("", curveZProperty.animationCurveValue, GUILayout.Width(CurveWidth), GUILayout.Height(CurveWidth));
            }

            if (RequireCurveCount == 4 && TweenParam.CurveMode == CurveMode.Independent)
            {
                var curveXProperty = TweenParamProperty.FindProperty(TweenKey.CurveX);
                curveXProperty.animationCurveValue = EditorGUILayout.CurveField("Curve XYZW", curveXProperty.animationCurveValue, GUILayout.Width(EditorGUIUtility.labelWidth + CurveWidth), GUILayout.Height(CurveWidth));
                var curveYProperty = TweenParamProperty.FindProperty(TweenKey.CurveY);
                curveYProperty.animationCurveValue = EditorGUILayout.CurveField("", curveYProperty.animationCurveValue, GUILayout.Width(CurveWidth), GUILayout.Height(CurveWidth));
                var curveZProperty = TweenParamProperty.FindProperty(TweenKey.CurveZ);
                curveZProperty.animationCurveValue = EditorGUILayout.CurveField("", curveZProperty.animationCurveValue, GUILayout.Width(CurveWidth), GUILayout.Height(CurveWidth));
                var curveWProperty = TweenParamProperty.FindProperty(TweenKey.CurveW);
                curveWProperty.animationCurveValue = EditorGUILayout.CurveField("", curveWProperty.animationCurveValue, GUILayout.Width(CurveWidth), GUILayout.Height(CurveWidth));
            }

            GUILayout.EndHorizontal();

            return(true);
        }
Ejemplo n.º 19
0
        public virtual void CacheProperty()
        {
            FromFloatProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.FromFloat);
            ToFloatProperty        = TweenParamProperty.FindPropertyRelative(TweenKey.ToFloat);
            FromVector2Property    = TweenParamProperty.FindPropertyRelative(TweenKey.FromVector2);
            ToVector2Property      = TweenParamProperty.FindPropertyRelative(TweenKey.ToVector2);
            FromVector3Property    = TweenParamProperty.FindPropertyRelative(TweenKey.FromVector3);
            ToVector3Property      = TweenParamProperty.FindPropertyRelative(TweenKey.ToVector3);
            FromVector4Property    = TweenParamProperty.FindPropertyRelative(TweenKey.FromVector4);
            ToVector4Property      = TweenParamProperty.FindPropertyRelative(TweenKey.ToVector4);
            FromColorProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.FromColor);
            ToColorProperty        = TweenParamProperty.FindPropertyRelative(TweenKey.ToColor);
            FromQuaternionProperty = TweenParamProperty.FindPropertyRelative(TweenKey.FromQuaternion);
            ToQuaternionProperty   = TweenParamProperty.FindPropertyRelative(TweenKey.ToQuaternion);
            FromRectProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.FromRect);
            ToRectProperty         = TweenParamProperty.FindPropertyRelative(TweenKey.ToRect);
            FromStrProperty        = TweenParamProperty.FindPropertyRelative(TweenKey.FromStr);
            ToStrProperty          = TweenParamProperty.FindPropertyRelative(TweenKey.ToStr);
            FromTransformProperty  = TweenParamProperty.FindPropertyRelative(TweenKey.FromTransform);
            ToTransformProperty    = TweenParamProperty.FindPropertyRelative(TweenKey.ToTransform);

            QueueVector3Property = TweenParamProperty.FindPropertyRelative(TweenKey.QueueVector3);
            QueueColorProperty   = TweenParamProperty.FindPropertyRelative(TweenKey.QueueColor);

            ResourceIndexProperty = TweenParamProperty.FindPropertyRelative(TweenKey.ResourcesIndex);
            ResourceKeyProperty   = TweenParamProperty.FindPropertyRelative(TweenKey.ResourcesKey);
            CurveTargetProperty   = TweenParamProperty.FindPropertyRelative(TweenKey.CurveTarget);
            CurveModeProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.CurveMode);

            CurveProperty  = TweenParamProperty.FindPropertyRelative(TweenKey.Curve);
            CurveXProperty = TweenParamProperty.FindPropertyRelative(TweenKey.CurveX);
            CurveYProperty = TweenParamProperty.FindPropertyRelative(TweenKey.CurveY);
            CurveZProperty = TweenParamProperty.FindPropertyRelative(TweenKey.CurveZ);
            CurveWProperty = TweenParamProperty.FindPropertyRelative(TweenKey.CurveW);

            PlayTypeProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.PlayType);
            EaseTypeProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.EaseType);
            LoopCountProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.LoopCount);
            DurationProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.Duration);
            StartDelayProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.StartDelay);
            IntervalProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.Interval);
            SpeedBasedProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.SpeedBased);
            AutoPlayProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.AutoPlay);
            UpdateTypeProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.UpdateType);
            TimeScaleProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.TimeScale);
            TimeSmoothProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.TimeSmooth);
            SelfScaleProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.SelfScale);
            AutoKillProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.AutoKill);
            ColorLerpModeProperty  = TweenParamProperty.FindPropertyRelative(TweenKey.ColorLerpMode);
            ColorBlockTypeProperty = TweenParamProperty.FindPropertyRelative(TweenKey.ColorBlockType);
            WorldSpaceProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.WorldSpace);
            ShakeArgsProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.ShakeArgs);
            PathModeProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.PathMode);

            OnPlayProperty            = TweenParamProperty.FindPropertyRelative(TweenKey.OnPlay);
            OnStopProperty            = TweenParamProperty.FindPropertyRelative(TweenKey.OnStop);
            OnValueFloatProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueFloat);
            OnValueVector2Property    = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueVector2);
            OnValueVector3Property    = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueVector3);
            OnValueVector4Property    = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueVector4);
            OnValueColorProperty      = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueColor);
            OnValueQuaternionProperty = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueQuaternion);
            OnValueRectProperty       = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueRect);
            OnValueStringProperty     = TweenParamProperty.FindPropertyRelative(TweenKey.OnValueString);

            IsCacheProperty = true;
        }