/// <summary>
        /// Draws the inspector.
        /// </summary>
        new public static MovementVariable[] DrawInspector(MovementVariable[] movementData, ref bool showDetails, Character target)
        {
            if (movementData == null || movementData.Length < MovementVariableCount)
            {
                movementData = new MovementVariable[MovementVariableCount];
            }

            // Walk speed
            if (movementData[SpeedIndex] == null)
            {
                movementData[SpeedIndex] = new MovementVariable();
            }
            movementData[SpeedIndex].FloatValue = EditorGUILayout.FloatField(new GUIContent("Speed", "How fast the character walks."), movementData[SpeedIndex].FloatValue);
            if (movementData[SpeedIndex].FloatValue < 0)
            {
                movementData[SpeedIndex].FloatValue = 0.0f;
            }

            // Draw base inspector and copy values
            MovementVariable[] baseMovementData = GroundMovement_Crouch.DrawInspector(movementData, ref showDetails, target);
            System.Array.Copy(baseMovementData, movementData, baseMovementData.Length);


            return(movementData);
        }
Esempio n. 2
0
        /// <summary>
        /// Draws the inspector.
        /// </summary>
        new public static MovementVariable[] DrawInspector(MovementVariable[] movementData, ref bool showDetails, Character target)
        {
            if (movementData == null || movementData.Length < MovementVariableCount)
            {
                movementData = new MovementVariable[MovementVariableCount];
            }

            // Draw base inspector and copy values
            MovementVariable[] baseMovementData = GroundMovement_Crouch.DrawInspector(movementData, ref showDetails, target);
            System.Array.Copy(baseMovementData, movementData, baseMovementData.Length);

            // Start crouch only by pressing down
            if (movementData[CrouchStartMustBeDownIndex] == null)
            {
                movementData[CrouchStartMustBeDownIndex] = new MovementVariable();
            }
            movementData[CrouchStartMustBeDownIndex].BoolValue = EditorGUILayout.Toggle(new GUIContent("Start Crouch With Down", "If true the character can only start the crouch when pressing directly down, not diagonally down."), movementData[CrouchStartMustBeDownIndex].BoolValue);

            return(movementData);
        }
Esempio n. 3
0
        /// <summary>
        /// Draws the inspector.
        /// </summary>
        new public static MovementVariable[] DrawInspector(MovementVariable[] movementData, ref bool showDetails, Character target)
        {
            if (movementData == null || movementData.Length < MovementVariableCount)
            {
                movementData = new MovementVariable[MovementVariableCount];
            }

            // Start crouch only by pressing down
            if (movementData[MinimumSpeedForSlideIndex] == null)
            {
                movementData[MinimumSpeedForSlideIndex] = new MovementVariable(DefaultMinimumSpeedForSlide);
            }
            movementData[MinimumSpeedForSlideIndex].FloatValue = EditorGUILayout.FloatField(new GUIContent("Minimum Speed for Slide", "How fast does the character have to go before they will go in to crouch slide instead of just crouching?"), movementData[MinimumSpeedForSlideIndex].FloatValue);
            if (movementData[MinimumSpeedForSlideIndex].FloatValue < 0)
            {
                movementData[MinimumSpeedForSlideIndex].FloatValue = 0.0f;
            }

            // Max Speed
            if (movementData[MaxSpeedIndex] == null)
            {
                movementData[MaxSpeedIndex] = new MovementVariable();
            }
            movementData[MaxSpeedIndex].FloatValue = EditorGUILayout.FloatField(new GUIContent("Maximum Speed", "The characters peak speed, required as we may accelerate down a hill."), movementData[MaxSpeedIndex].FloatValue);
            if (movementData[MaxSpeedIndex].FloatValue < 0)
            {
                movementData[MaxSpeedIndex].FloatValue = 0.0f;
            }

            // Draw base inspector and copy values
            MovementVariable[] baseMovementData = GroundMovement_Crouch.DrawInspector(movementData, ref showDetails, target);
            System.Array.Copy(baseMovementData, movementData, baseMovementData.Length);

            GroundMovement_Physics.DrawStandardPhysicsSettings(movementData, PhysicsMovementDataIndexOffset, showDetails);

            return(movementData);
        }