Corgi Engine  v8.8
MoreMountains.CorgiEngine.CharacterLevelBounds Class Reference

This class handles what happens when the player reaches the level bounds. For each bound (above, below, left, right), you can define if the player will be killed, or if its movement will be constrained, or if nothing happens More...

Inheritance diagram for MoreMountains.CorgiEngine.CharacterLevelBounds:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Types

enum  BoundsBehavior { BoundsBehavior.Nothing, BoundsBehavior.Constrain, BoundsBehavior.Kill }
 the possible consequences of touching the level bounds More...
 

Public Member Functions

virtual void Start ()
 Initialization More...
 
virtual void LateUpdate ()
 Every frame, we check if the player is colliding with a level bound More...
 

Public Attributes

BoundsBehavior Top = BoundsBehavior.Constrain
 what to do to the player when it reaches the top level bound More...
 
BoundsBehavior Bottom = BoundsBehavior.Kill
 what to do to the player when it reaches the bottom level bound More...
 
BoundsBehavior Left = BoundsBehavior.Constrain
 what to do to the player when it reaches the left level bound More...
 
BoundsBehavior Right = BoundsBehavior.Constrain
 what to do to the player when it reaches the right level bound More...
 
bool ResetForcesOnConstrain = true
 if this is true, controller forces will also be reset (on the appropriate axis) when constraining More...
 

Protected Member Functions

virtual void ApplyBoundsBehavior (BoundsBehavior behavior, Vector2 constrainedPosition)
 Applies the specified bound behavior to the player More...
 

Protected Attributes

Bounds _bounds
 
CorgiController _controller
 
Character _character
 
Vector2 _constrainedPosition
 
OneWayLevelManager _oneWayLevelManager
 

Detailed Description

This class handles what happens when the player reaches the level bounds. For each bound (above, below, left, right), you can define if the player will be killed, or if its movement will be constrained, or if nothing happens

Member Enumeration Documentation

◆ BoundsBehavior

the possible consequences of touching the level bounds

Enumerator
Nothing 
Constrain 
Kill 

Member Function Documentation

◆ ApplyBoundsBehavior()

virtual void MoreMountains.CorgiEngine.CharacterLevelBounds.ApplyBoundsBehavior ( BoundsBehavior  behavior,
Vector2  constrainedPosition 
)
protectedvirtual

Applies the specified bound behavior to the player

Parameters
behaviorBehavior.
constrainedPositionConstrained position.

◆ LateUpdate()

virtual void MoreMountains.CorgiEngine.CharacterLevelBounds.LateUpdate ( )
virtual

Every frame, we check if the player is colliding with a level bound

◆ Start()

virtual void MoreMountains.CorgiEngine.CharacterLevelBounds.Start ( )
virtual

Initialization

Member Data Documentation

◆ _bounds

Bounds MoreMountains.CorgiEngine.CharacterLevelBounds._bounds
protected

◆ _character

Character MoreMountains.CorgiEngine.CharacterLevelBounds._character
protected

◆ _constrainedPosition

Vector2 MoreMountains.CorgiEngine.CharacterLevelBounds._constrainedPosition
protected

◆ _controller

CorgiController MoreMountains.CorgiEngine.CharacterLevelBounds._controller
protected

◆ _oneWayLevelManager

OneWayLevelManager MoreMountains.CorgiEngine.CharacterLevelBounds._oneWayLevelManager
protected

◆ Bottom

BoundsBehavior MoreMountains.CorgiEngine.CharacterLevelBounds.Bottom = BoundsBehavior.Kill

what to do to the player when it reaches the bottom level bound

◆ Left

BoundsBehavior MoreMountains.CorgiEngine.CharacterLevelBounds.Left = BoundsBehavior.Constrain

what to do to the player when it reaches the left level bound

◆ ResetForcesOnConstrain

bool MoreMountains.CorgiEngine.CharacterLevelBounds.ResetForcesOnConstrain = true

if this is true, controller forces will also be reset (on the appropriate axis) when constraining

◆ Right

BoundsBehavior MoreMountains.CorgiEngine.CharacterLevelBounds.Right = BoundsBehavior.Constrain

what to do to the player when it reaches the right level bound

◆ Top

BoundsBehavior MoreMountains.CorgiEngine.CharacterLevelBounds.Top = BoundsBehavior.Constrain

what to do to the player when it reaches the top level bound


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