C# Class ProjectStorms.InputManager

Just the raw controller inputs. These are mainly passed into the airship movement controls, but also effect suicide/fireship and roulette controls.
Inheritance: UnityEngine.MonoBehaviour
Show file Open project: patferguson/Storms-Project

Public Methods

Method Description
Awake ( ) : void
GetAnyButtonDown ( string a_playerTag ) : bool

Checks whether any input has been pressed for the input player.

SetControllerVibrate ( string a_playerTag, float a_motorLeft, float a_motorRight, float a_rumbleDurr, bool a_shouldShakeScreen = false ) : void

Makes the input controller vibrate.

Private Methods

Method Description
ApplyRumble ( ) : void
ShakeScreenForPlayer ( string a_playerTag, float a_shakeStr, float a_shakeDurr ) : void

Shakes the the screen for the input player.

Start ( ) : void
Update ( ) : void

This input stuff was all figured out in an old script called 'TempDebugScript'. It's clever, because it determines which input to look for based off the player tag. InputManager update is set to run before anything else.

Method Details

Awake() public method

public Awake ( ) : void
return void

GetAnyButtonDown() public static method

Checks whether any input has been pressed for the input player.
public static GetAnyButtonDown ( string a_playerTag ) : bool
a_playerTag string Input player's tag.
return bool

SetControllerVibrate() public static method

Makes the input controller vibrate.
public static SetControllerVibrate ( string a_playerTag, float a_motorLeft, float a_motorRight, float a_rumbleDurr, bool a_shouldShakeScreen = false ) : void
a_playerTag string
a_motorLeft float Vibration value for the left controller motor. Should have a maximum of 1. Is a percentage value.
a_motorRight float Vibration value for the right controller motor. Should have a maximum of 1. Is a percentage value.
a_rumbleDurr float How long to rumble for in seconds.
a_shouldShakeScreen bool True if the screen should also be shaken with the maximum
return void