Beispiel #1
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_Digital.DrawInspector(movementData, ref showDetails, target);
            System.Array.Copy(baseMovementData, movementData, baseMovementData.Length);

            // Friction
            if (movementData[FrictionIndex] == null)
            {
                movementData[FrictionIndex] = new MovementVariable(DefaultFriction);
            }
            movementData[FrictionIndex].FloatValue = EditorGUILayout.FloatField(new GUIContent("Friction", "Controls how quickly the character comes to a stop."), movementData[FrictionIndex].FloatValue);

            // Quiesce Speed
            if (movementData[QuiesceSpeedIndex] == null)
            {
                movementData[QuiesceSpeedIndex] = new MovementVariable(DefaultQuiesceSpeed);
            }
            movementData[QuiesceSpeedIndex].FloatValue = EditorGUILayout.FloatField(new GUIContent("Quiesce Speed", "Speed at which slide turns to stop."), movementData[QuiesceSpeedIndex].FloatValue);
            if (movementData[QuiesceSpeedIndex].FloatValue < 0)
            {
                movementData[QuiesceSpeedIndex].FloatValue = 0.0f;
            }


            return(movementData);
        }
        /// <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];
            }

            // Cancel Run On Side Collision
            if (movementData[CancelRunOnSideCollisionIndex] == null)
            {
                movementData[CancelRunOnSideCollisionIndex] = new MovementVariable();
            }
            movementData[CancelRunOnSideCollisionIndex].BoolValue = EditorGUILayout.Toggle(new GUIContent("Cancel Run on Collision", " Should we cancel run on side collission or just play a PUSH animation."), movementData[CancelRunOnSideCollisionIndex].BoolValue);

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

            return(movementData);
        }
Beispiel #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];
            }

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

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

            return(movementData);
        }