Corgi Engine
v9.0
|
A controller for the level map's main character More...
Public Member Functions | |
virtual void | InputMovement () |
Handles input and decides if we can move or not More... | |
virtual void | MoveCharacter () |
Moves the character to the set destination More... | |
virtual void | AnimateCharacter () |
Animates the character if it has an animator set Also flips the character if needed More... | |
virtual void | SetCurrentPathElement (LevelMapPathElement pathElement) |
Sets the current path element. More... | |
virtual void | SetDestination (LevelMapPathElement newDestination) |
Sets the destination. More... | |
Public Attributes | |
string | PlayerID = "Player1" |
the player ID (for input manager) More... | |
float | CharacterSpeed |
the character's movement speed More... | |
LevelMapPathElement | StartingPoint |
the point on the map at which the character should spawn More... | |
bool | CharacterIsFacingRight =true |
true if the character is currently facing right More... | |
Protected Member Functions | |
virtual void | Start () |
Initialization More... | |
virtual void | Update () |
On update, we get the input, decide if we should move or not, and if needed move the character and animate it More... | |
virtual void | Flip () |
Flip the character horizontally More... | |
virtual void | ButtonPressed () |
When the jump button is pressed More... | |
virtual void | SetHorizontalMove (float value) |
Sets the horizontal move. More... | |
virtual void | SetVerticalMove (float value) |
Sets the vertical move. More... | |
Protected Attributes | |
LevelMapPathElement | _destination |
bool | _shouldMove =false |
float | _horizontalMove |
float | _verticalMove |
float | _threshold =0.1f |
Vector3 | _offset |
Vector3 | _positionLastFrame |
float | _currentSpeed =0f |
string | _movement |
LevelMapPathElement | _currentPathElement |
Rigidbody2D | _rigidbody2D |
BoxCollider2D | _boxCollider2D |
Animator | _animator |
Properties | |
bool | CollidingWithAPathElement [get, set] |
true if the character colliding with a path element at this frame More... | |
LevelMapPathElement | LastVisitedPathElement [get, set] |
the last visited path element More... | |
A controller for the level map's main character
|
virtual |
Animates the character if it has an animator set Also flips the character if needed
|
protectedvirtual |
When the jump button is pressed
|
protectedvirtual |
Flip the character horizontally
|
virtual |
Handles input and decides if we can move or not
movement | Movement. |
|
virtual |
Moves the character to the set destination
|
virtual |
Sets the current path element.
pathElement | Path element. |
|
virtual |
Sets the destination.
newDestination | New destination. |
|
protectedvirtual |
Sets the horizontal move.
value | Value. |
|
protectedvirtual |
Sets the vertical move.
value | Value. |
|
protectedvirtual |
Initialization
|
protectedvirtual |
On update, we get the input, decide if we should move or not, and if needed move the character and animate it
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.CorgiEngine.LevelMapCharacter.CharacterIsFacingRight =true |
true if the character is currently facing right
float MoreMountains.CorgiEngine.LevelMapCharacter.CharacterSpeed |
the character's movement speed
string MoreMountains.CorgiEngine.LevelMapCharacter.PlayerID = "Player1" |
the player ID (for input manager)
LevelMapPathElement MoreMountains.CorgiEngine.LevelMapCharacter.StartingPoint |
the point on the map at which the character should spawn
|
getset |
true if the character colliding with a path element at this frame
|
getset |
the last visited path element