C# Class SlothController

Inheritance: MonoBehaviour
Exibir arquivo Open project: ferdbold/littleawfuljam2016 Class Usage Examples

Public Properties

Property Type Description
leftHandCollider UnityEngine.SphereCollider
wallLayerMask LayerMask

Public Methods

Method Description
ActivateControls ( ) : void
AreControlsEnabled ( ) : bool
DeactivateControls ( ) : void
MoveLeft ( float holdTime ) : void

Move Left Input was pressed

MoveRight ( float holdTime ) : void

Move Right Input was pressed

OnCollisionLeftHand ( ) : void

Called when LeftHand Collider hits a wall

OnCollisionRightHand ( ) : void

Called when RightHand Collider hits a wall

ToggleTurnLeft ( bool isTurning ) : void

Input for Turn Left was modified

ToggleTurnRight ( bool isTurning ) : void

Input for Turn Left was modified

Private Methods

Method Description
Awake ( ) : void
MoveSloth ( bool isRight, float holdTime ) : IEnumerator

Initiate a sloth movement

PushSloth ( Vector3 force ) : IEnumerator
RotateSloth ( Vector3 rotation, float animTime, AnimationCurve animCurve ) : IEnumerator

Rotate the transform based on given rotation, time and curve

Start ( ) : void
StartCooldownMoveLeft ( ) : IEnumerator

Left Move Cooldown

StartCooldownMoveRight ( ) : IEnumerator

Right Move Cooldown

Update ( ) : void

Method Details

ActivateControls() public method

public ActivateControls ( ) : void
return void

AreControlsEnabled() public method

public AreControlsEnabled ( ) : bool
return bool

DeactivateControls() public method

public DeactivateControls ( ) : void
return void

MoveLeft() public method

Move Left Input was pressed
public MoveLeft ( float holdTime ) : void
holdTime float
return void

MoveRight() public method

Move Right Input was pressed
public MoveRight ( float holdTime ) : void
holdTime float
return void

OnCollisionLeftHand() public method

Called when LeftHand Collider hits a wall
public OnCollisionLeftHand ( ) : void
return void

OnCollisionRightHand() public method

Called when RightHand Collider hits a wall
public OnCollisionRightHand ( ) : void
return void

ToggleTurnLeft() public method

Input for Turn Left was modified
public ToggleTurnLeft ( bool isTurning ) : void
isTurning bool
return void

ToggleTurnRight() public method

Input for Turn Left was modified
public ToggleTurnRight ( bool isTurning ) : void
isTurning bool
return void

Property Details

leftHandCollider public_oe property

public SphereCollider,UnityEngine leftHandCollider
return UnityEngine.SphereCollider

wallLayerMask public_oe property

public LayerMask wallLayerMask
return LayerMask