platformer
Public Member Functions | List of all members
UnityPlatformer.AIInput Class Reference

Fake input for AI. More...

Inheritance diagram for UnityPlatformer.AIInput:
UnityPlatformer.PlatformerInput

Public Member Functions

void EnableAction (string action)
 Enable action More...
 
void DisableAction (string action)
 Disable action More...
 
void SetAxis (Vector2 v)
 Modify axis More...
 
void SetX (float x)
 Modify X axis More...
 
void SetY (float y)
 Modify Y axis 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...
 
- Public Member Functions inherited from UnityPlatformer.PlatformerInput
delegate void InputActionDelegate (string button)
 callback type for keyup/keydown More...
 
virtual void Start ()
 Init actions Dictionary More...
 
virtual void Update ()
 Listen to changs in Unity Input More...
 

Additional Inherited Members

- 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...
 
- Protected Attributes inherited from UnityPlatformer.PlatformerInput
InputDictionary actions = new InputDictionary()
 Dictionary of actions/states More...
 

Detailed Description

Fake input for AI.

Allow to manually (by code) control input/actions.
This way a AI is exactly like a playable character so no code duplication :)

Member Function Documentation

◆ DisableAction()

void UnityPlatformer.AIInput.DisableAction ( string  action)
inline

Disable action

◆ EnableAction()

void UnityPlatformer.AIInput.EnableAction ( string  action)
inline

Enable action

◆ GetAxisRaw()

override Vector2 UnityPlatformer.AIInput.GetAxisRaw ( )
inlinevirtual

Returns a Vector2 with GetAxisRawX and GetAxisRawY

Implements UnityPlatformer.PlatformerInput.

◆ GetAxisRawX()

override float UnityPlatformer.AIInput.GetAxisRawX ( )
inlinevirtual

Returns Input.GetAxisRaw ("Horizontal") or equivalent

Implements UnityPlatformer.PlatformerInput.

◆ GetAxisRawY()

override float UnityPlatformer.AIInput.GetAxisRawY ( )
inlinevirtual

Returns Input.GetAxisRaw ("Vertical") or equivalent

Implements UnityPlatformer.PlatformerInput.

◆ IsActionDown()

override bool UnityPlatformer.AIInput.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.AIInput.IsActionHeld ( string  action)
inlinevirtual

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

Implements UnityPlatformer.PlatformerInput.

◆ IsActionUp()

override bool UnityPlatformer.AIInput.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.AIInput.IsDownDown ( )
inlinevirtual

Returns true while Down is down.

Implements UnityPlatformer.PlatformerInput.

◆ IsLeftDown()

override bool UnityPlatformer.AIInput.IsLeftDown ( )
inlinevirtual

Returns true while Left is down.

Implements UnityPlatformer.PlatformerInput.

◆ IsRightDown()

override bool UnityPlatformer.AIInput.IsRightDown ( )
inlinevirtual

Returns true while Right is down.

Implements UnityPlatformer.PlatformerInput.

◆ IsUpDown()

override bool UnityPlatformer.AIInput.IsUpDown ( )
inlinevirtual

Returns true while Up is down.

Implements UnityPlatformer.PlatformerInput.

◆ SetAxis()

void UnityPlatformer.AIInput.SetAxis ( Vector2  v)
inline

Modify axis

◆ SetX()

void UnityPlatformer.AIInput.SetX ( float  x)
inline

Modify X axis

◆ SetY()

void UnityPlatformer.AIInput.SetY ( float  y)
inline

Modify Y axis


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