platformer
Classes | Public Member Functions | Public Attributes | List of all members
UnityPlatformer.DefaultInput Class Reference

Keyboard, Touch and Wii More...

Inheritance diagram for UnityPlatformer.DefaultInput:
UnityPlatformer.PlatformerInput

Classes

class  InputMapping
 Maps between various inputs methods and action (string) More...
 

Public Member Functions

override void Start ()
 Init actions Dictionary More...
 
override bool IsActionHeld (string action)
 Returns true while the Action(~Button) is held down. More...
 
override bool IsActionDown (string action)
 Returns true this frame the Action(~Button) is down. NOTE you could miss down event, use Held instead More...
 
override bool IsActionUp (string action)
 Returns true this frame the Action(~Button) is up. NOTE you could miss up event, use Held instead More...
 
override bool IsLeftDown ()
 Returns true while Left is down. More...
 
override bool IsRightDown ()
 Returns true while Right is down. More...
 
override bool IsUpDown ()
 Returns true while Up is down. More...
 
override bool IsDownDown ()
 Returns true while Down is down. More...
 
override float GetAxisRawX ()
 Returns Input.GetAxisRaw ("Horizontal") or equivalent More...
 
override float GetAxisRawY ()
 Returns Input.GetAxisRaw ("Vertical") or equivalent More...
 
override Vector2 GetAxisRaw ()
 Returns a Vector2 with GetAxisRawX and GetAxisRawY More...
 
override void Update ()
 Listen to changs in Unity Input More...
 
- Public Member Functions inherited from UnityPlatformer.PlatformerInput
delegate void InputActionDelegate (string button)
 callback type for keyup/keydown More...
 

Public Attributes

List< InputMappinginputsMap
 List of action - button/key mapping More...
 
- Public Attributes inherited from UnityPlatformer.PlatformerInput
List< string > listenActions = new List<string> {"Jump", "Attack", "Use", "Run", "Pull"}
 List of all available actions to listen More...
 
InputActionDelegate onActionUp
 callback when action up (key/button associated is up) More...
 
InputActionDelegate onActionDown
 callback when action down (key/button associated is down) More...
 

Additional Inherited Members

- Protected Attributes inherited from UnityPlatformer.PlatformerInput
InputDictionary actions = new InputDictionary()
 Dictionary of actions/states More...
 

Detailed Description

Keyboard, Touch and Wii

Touch use CnControls [https://www.assetstore.unity3d.com/en/#!/content/15233] to enable touch you need to uncomment '#define UP_USE_CN_INPUT_MANAGER' at the top of this file
Wii controls use WiimoteApi [https://github.com/Flafla2/Unity-Wiimote] to enable wiimote support you need to uncomment '#define UP_USE_WII_INPUT_MANAGER' at the top of this file

Member Function Documentation

◆ GetAxisRaw()

override Vector2 UnityPlatformer.DefaultInput.GetAxisRaw ( )
inlinevirtual

Returns a Vector2 with GetAxisRawX and GetAxisRawY

Implements UnityPlatformer.PlatformerInput.

◆ GetAxisRawX()

override float UnityPlatformer.DefaultInput.GetAxisRawX ( )
inlinevirtual

Returns Input.GetAxisRaw ("Horizontal") or equivalent

Implements UnityPlatformer.PlatformerInput.

◆ GetAxisRawY()

override float UnityPlatformer.DefaultInput.GetAxisRawY ( )
inlinevirtual

Returns Input.GetAxisRaw ("Vertical") or equivalent

Implements UnityPlatformer.PlatformerInput.

◆ IsActionDown()

override bool UnityPlatformer.DefaultInput.IsActionDown ( string  action)
inlinevirtual

Returns true this frame the Action(~Button) is down. NOTE you could miss down event, use Held instead

Implements UnityPlatformer.PlatformerInput.

◆ IsActionHeld()

override bool UnityPlatformer.DefaultInput.IsActionHeld ( string  action)
inlinevirtual

Returns true while the Action(~Button) is held down.

Implements UnityPlatformer.PlatformerInput.

◆ IsActionUp()

override bool UnityPlatformer.DefaultInput.IsActionUp ( string  action)
inlinevirtual

Returns true this frame the Action(~Button) is up. NOTE you could miss up event, use Held instead

Implements UnityPlatformer.PlatformerInput.

◆ IsDownDown()

override bool UnityPlatformer.DefaultInput.IsDownDown ( )
inlinevirtual

Returns true while Down is down.

Implements UnityPlatformer.PlatformerInput.

◆ IsLeftDown()

override bool UnityPlatformer.DefaultInput.IsLeftDown ( )
inlinevirtual

Returns true while Left is down.

Implements UnityPlatformer.PlatformerInput.

◆ IsRightDown()

override bool UnityPlatformer.DefaultInput.IsRightDown ( )
inlinevirtual

Returns true while Right is down.

Implements UnityPlatformer.PlatformerInput.

◆ IsUpDown()

override bool UnityPlatformer.DefaultInput.IsUpDown ( )
inlinevirtual

Returns true while Up is down.

Implements UnityPlatformer.PlatformerInput.

◆ Start()

override void UnityPlatformer.DefaultInput.Start ( )
inlinevirtual

Init actions Dictionary

Reimplemented from UnityPlatformer.PlatformerInput.

◆ Update()

override void UnityPlatformer.DefaultInput.Update ( )
inlinevirtual

Listen to changs in Unity Input

Reimplemented from UnityPlatformer.PlatformerInput.

Member Data Documentation

◆ inputsMap

List<InputMapping> UnityPlatformer.DefaultInput.inputsMap
Initial value:
= new List<InputMapping> {
new InputMapping (
"Jump",
"Jump",
"Jump",
WiiButtons.WII_BUTTON_1
), new InputMapping (
"Attack",
"Attack",
"Fire2",
WiiButtons.WII_BUTTON_2
), new InputMapping (
"Use",
"Use",
"Fire1",
WiiButtons.WII_BUTTON_A
), new InputMapping (
"Run",
"Use",
"Run",
WiiButtons.WII_BUTTON_B
), new InputMapping (
"Pull",
"Pull",
"Pull",
WiiButtons.WII_BUTTON_B
)
}

List of action - button/key mapping


The documentation for this class was generated from the following file: