Corgi Engine  v8.8
MoreMountains.CorgiEngine.OneWayLevelManager Class Reference
Inheritance diagram for MoreMountains.CorgiEngine.OneWayLevelManager:
MoreMountains.Tools.MMSingleton< OneWayLevelManager > MoreMountains.Tools.MMEventListener< CorgiEngineEvent >

Public Types

enum  OneWayLevelDirections {
  OneWayLevelDirections.None, OneWayLevelDirections.Left, OneWayLevelDirections.Right, OneWayLevelDirections.Up,
  OneWayLevelDirections.Down
}
 
enum  OneWayLevelKillModes { OneWayLevelKillModes.NoKill, OneWayLevelKillModes.Kill }
 

Public Member Functions

virtual void SetPreventGoingBack (bool status)
 Forces the level to prevent being able to go back in the opposite direction, or not More...
 
virtual void SetOneWayLevelAutoScrolling (bool status)
 Forces auto scroll to the value passed in parameters More...
 
virtual void SetOneWayLevelAutoScrollingSpeed (float newSpeed)
 Sets the auto scrolling speed More...
 
virtual void OnMMEvent (CorgiEngineEvent corgiEngineEvent)
 On LevelStart we initialize, on Respawn we reset our bounds values More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< CorgiEngineEvent >
void OnMMEvent (T eventType)
 

Public Attributes

OneWayLevelDirections OneWayLevelDirection = OneWayLevelDirections.None
 specifies the direction of the level (from level start to finish/goal - Mario's levels would typically be Right here) More...
 
bool PreventGoingBack = true
 if this is true you won't be able to go back in the level More...
 
float ThresholdDistance = 5f
 the maximum distance at which the NoGoingBack object should stay from the player character More...
 
bool OneWayLevelAutoScrolling = false
 if this is true, the level bounds will be modified so that the level auto scrolls towards the OneWayLevelDirection More...
 
Camera MainCamera
 the main camera to use to compute the size of the modified constrained bounds More...
 
float OneWayLevelAutoScrollingSpeed = 1f
 the speed at which the level should auto scroll More...
 

Protected Member Functions

virtual void Initialization ()
 Stores initial values, and performs safety checks More...
 
virtual void Update ()
 On Update, we trigger our loop methods More...
 
virtual void HandlePreventGoingBack ()
 Modifies the level bounds to prevent being able to go back More...
 
virtual void HandleAutoMovement ()
 Makes the level auto scroll by modifying its level bounds dynamically, which forces the camera to "move" More...
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 On disable we stop listening for events More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< OneWayLevelManager >
virtual void Awake ()
 On awake, we initialize our instance. Make sure to call base.Awake() in override if you need awake. More...
 
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Static Protected Member Functions

static void InitializeStatics ()
 Statics initialization to support enter play modes More...
 

Protected Attributes

Transform _cameraTarget
 
Vector2 _direction
 
float _offsetAdjuster
 
Transform Target
 
Vector3 MinBounds
 
Vector3 MaxBounds
 
Vector3 _minBoundsLastFrame
 
Vector3 _maxBoundsLastFrame
 
bool _initialOneWayLevelAutoScrolling
 
float _initialOneWayLevelAutoScrollingSpeed
 

Additional Inherited Members

- Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< OneWayLevelManager >
static T TryGetInstance ()
 
- Static Public Attributes inherited from MoreMountains.Tools.MMSingleton< OneWayLevelManager >
static bool HasInstance
 
static T Current
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< OneWayLevelManager >
static T _instance
 
- Properties inherited from MoreMountains.Tools.MMSingleton< OneWayLevelManager >
static T Instance [get]
 Singleton design pattern More...
 

Member Enumeration Documentation

◆ OneWayLevelDirections

Enumerator
None 
Left 
Right 
Up 
Down 

◆ OneWayLevelKillModes

Member Function Documentation

◆ HandleAutoMovement()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.HandleAutoMovement ( )
protectedvirtual

Makes the level auto scroll by modifying its level bounds dynamically, which forces the camera to "move"

◆ HandlePreventGoingBack()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.HandlePreventGoingBack ( )
protectedvirtual

Modifies the level bounds to prevent being able to go back

◆ Initialization()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.Initialization ( )
protectedvirtual

Stores initial values, and performs safety checks

◆ InitializeStatics()

static void MoreMountains.CorgiEngine.OneWayLevelManager.InitializeStatics ( )
staticprotected

Statics initialization to support enter play modes

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.OnDisable ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.OnEnable ( )
protectedvirtual

◆ OnMMEvent()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.OnMMEvent ( CorgiEngineEvent  corgiEngineEvent)
virtual

On LevelStart we initialize, on Respawn we reset our bounds values

Parameters
corgiEngineEvent

◆ SetOneWayLevelAutoScrolling()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.SetOneWayLevelAutoScrolling ( bool  status)
virtual

Forces auto scroll to the value passed in parameters

Parameters
status

◆ SetOneWayLevelAutoScrollingSpeed()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.SetOneWayLevelAutoScrollingSpeed ( float  newSpeed)
virtual

Sets the auto scrolling speed

Parameters
newSpeed

◆ SetPreventGoingBack()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.SetPreventGoingBack ( bool  status)
virtual

Forces the level to prevent being able to go back in the opposite direction, or not

Parameters
status

◆ Update()

virtual void MoreMountains.CorgiEngine.OneWayLevelManager.Update ( )
protectedvirtual

On Update, we trigger our loop methods

Member Data Documentation

◆ _cameraTarget

Transform MoreMountains.CorgiEngine.OneWayLevelManager._cameraTarget
protected

◆ _direction

Vector2 MoreMountains.CorgiEngine.OneWayLevelManager._direction
protected

◆ _initialOneWayLevelAutoScrolling

bool MoreMountains.CorgiEngine.OneWayLevelManager._initialOneWayLevelAutoScrolling
protected

◆ _initialOneWayLevelAutoScrollingSpeed

float MoreMountains.CorgiEngine.OneWayLevelManager._initialOneWayLevelAutoScrollingSpeed
protected

◆ _maxBoundsLastFrame

Vector3 MoreMountains.CorgiEngine.OneWayLevelManager._maxBoundsLastFrame
protected

◆ _minBoundsLastFrame

Vector3 MoreMountains.CorgiEngine.OneWayLevelManager._minBoundsLastFrame
protected

◆ _offsetAdjuster

float MoreMountains.CorgiEngine.OneWayLevelManager._offsetAdjuster
protected

◆ MainCamera

Camera MoreMountains.CorgiEngine.OneWayLevelManager.MainCamera

the main camera to use to compute the size of the modified constrained bounds

◆ MaxBounds

Vector3 MoreMountains.CorgiEngine.OneWayLevelManager.MaxBounds
protected

◆ MinBounds

Vector3 MoreMountains.CorgiEngine.OneWayLevelManager.MinBounds
protected

◆ OneWayLevelAutoScrolling

bool MoreMountains.CorgiEngine.OneWayLevelManager.OneWayLevelAutoScrolling = false

if this is true, the level bounds will be modified so that the level auto scrolls towards the OneWayLevelDirection

◆ OneWayLevelAutoScrollingSpeed

float MoreMountains.CorgiEngine.OneWayLevelManager.OneWayLevelAutoScrollingSpeed = 1f

the speed at which the level should auto scroll

◆ OneWayLevelDirection

OneWayLevelDirections MoreMountains.CorgiEngine.OneWayLevelManager.OneWayLevelDirection = OneWayLevelDirections.None

specifies the direction of the level (from level start to finish/goal - Mario's levels would typically be Right here)

◆ PreventGoingBack

bool MoreMountains.CorgiEngine.OneWayLevelManager.PreventGoingBack = true

if this is true you won't be able to go back in the level

◆ Target

Transform MoreMountains.CorgiEngine.OneWayLevelManager.Target
protected

◆ ThresholdDistance

float MoreMountains.CorgiEngine.OneWayLevelManager.ThresholdDistance = 5f

the maximum distance at which the NoGoingBack object should stay from the player character


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