Exemplo n.º 1
0
        private void DrawExtrap(AnimatorControllerParameterType type, ref ParameterExtrapolation e)
        {
            Rect r = EditorGUILayout.GetControlRect(GUILayout.MaxWidth(COL3));

            ParameterExtrapolation newe;



            if (type == AnimatorControllerParameterType.Bool || type == AnimatorControllerParameterType.Trigger)
            {
                newe = (ParameterExtrapolation)EditorGUI.EnumPopup(r, extGC, (ParameterMissingHold)e, new GUIStyle("MiniPopup")
                {
                    margin = new RectOffset(0, 0, 0, 0)
                });
            }
            else
            {
                newe = (ParameterExtrapolation)EditorGUI.EnumPopup(r, extGC, e, new GUIStyle("MiniPopup")
                {
                    margin = new RectOffset(0, 0, 0, 0)
                });
            }

            if (newe != e)
            {
                Undo.RecordObject(target, "Modify Sync Animator");
                e = newe;
            }
        }
Exemplo n.º 2
0
        // Constructor
        public ParameterSettings(int hash, ParameterDefaults defs, ref int paramCount, AnimatorControllerParameterType paramType)
        {
            this.hash      = hash;
            this.paramType = paramType;

            switch (paramType)
            {
            case AnimatorControllerParameterType.Float:
                include      = defs.includeFloats;
                interpolate  = defs.interpolateFloats;
                extrapolate  = defs.extrapolateFloats;
                defaultValue = (float)defs.defaultFloat;
                fcrusher     = new LiteFloatCrusher(LiteFloatCompressType.Half16, 0, 1, true);
                break;

            case AnimatorControllerParameterType.Int:
                include      = defs.includeInts;
                interpolate  = defs.interpolateInts;
                extrapolate  = defs.extrapolateInts;
                defaultValue = (int)defs.defaultInt;
                icrusher     = new LiteIntCrusher();
                break;

            case AnimatorControllerParameterType.Bool:
                include      = defs.includeBools;
                interpolate  = ParameterInterpolation.Hold;
                extrapolate  = ParameterExtrapolation.Hold;
                defaultValue = (bool)defs.defaultBool;
                break;

            case AnimatorControllerParameterType.Trigger:
                include      = defs.includeTriggers;
                interpolate  = ParameterInterpolation.Default;
                extrapolate  = ParameterExtrapolation.Default;
                defaultValue = (bool)defs.defaultTrigger;
                break;

            default:
                break;
            }
        }