using System; using UnityEngine; namespace Framework.Input.States { /// Inputs suitable for controlling a character in a platformer game public class PlatformerInputState { /// Initializes a new input state public PlatformerInputState() { this.Up = new Trigger(); this.Down = new Trigger(); this.Left = new Trigger(); this.Right = new Trigger(); this.Sprint = new Trigger(); this.Jump = new Trigger(); this.Fire = new Trigger(); this.Dash = new Trigger(); } /// Horizontal movement [ Action("Left", "Right"), DefaultKey(KeyCode.LeftArrow, KeyCode.RightArrow), DefaultJoystickAxis("Horizontal"), Description("Move left and right") ] public float Horizontal; /// /// Current state of the 'sprint' trigger used to move extra fast /// [ DefaultKey(KeyCode.LeftShift), DefaultKey(KeyCode.RightShift), DefaultKey(KeyCode.Joystick1Button2), Description("Run extra fast") ] public Trigger Sprint; /// /// Current state of the 'up' trigger used to climb, shoot upwards or submit /// [ DefaultKey(KeyCode.UpArrow), DefaultJoystickAxis("Vertical+"), Description("Catch ledges, climb up and aim") ] public Trigger Up; /// /// Current state of the 'down' trigger used to kneel, shoot downwards or submit /// [ DefaultKey(KeyCode.DownArrow), DefaultJoystickAxis("Vertical-"), Description("Let go of ledges, climb down and crouch") ] public Trigger Down; /// Current state of the 'left' trigger used to struggle [ DefaultKey(KeyCode.LeftArrow), DefaultJoystickAxis("Horizontal-"), Description("Move to the left") ] public Trigger Left; /// Current state of the 'right' trigger used to struggle [ DefaultKey(KeyCode.RightArrow), DefaultJoystickAxis("Horizontal+"), Description("Move to the right") ] public Trigger Right; /// Current state of the 'jump' trigger used to jump and wall-jump [ DefaultKey(KeyCode.X), DefaultKey(KeyCode.Space), DefaultKey(KeyCode.Joystick1Button1), Description("Jump up from the ground or jump off ledges") ] public Trigger Jump; /// Current state of the 'fire' trigger used to fire the gun [ DefaultKey(KeyCode.C), DefaultKey(KeyCode.Joystick1Button0), Description("Fire your weapon") ] public Trigger Fire; /// Current state of the 'dash' trigger used quickly move forward [ DefaultKey(KeyCode.Z), DefaultKey(KeyCode.Y), DefaultKey(KeyCode.Joystick1Button2), Description("Boost forward at high speed") ] public Trigger Dash; } } // namespace Framework.Input.States