Infinite Runner Engine v1.9
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
MoreMountains.InfiniteRunnerEngine.LevelManager Class Reference

Spawns the player, and More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.LevelManager:
MoreMountains.Tools.MMSingleton< LevelManager > MoreMountains.InfiniteRunnerEngine.SkyTheoryLevelManager

Public Types

enum  Controls { SingleButton , LeftRight , Swipe }
 

Public Member Functions

virtual void LevelStart ()
 Handles the start of the level : starts the autoincrementation of the score, sets the proper status and triggers the corresponding event. More...
 
virtual void ResetLevel ()
 Resets the level : repops dead characters, sets everything up for a new game More...
 
virtual void Update ()
 Every frame More...
 
virtual void SetSpeed (float newSpeed)
 Sets the speed. More...
 
virtual void AddSpeed (float speedAdded)
 Adds speed to the current level speed More...
 
virtual void TemporarilyMultiplySpeed (float factor, float duration)
 Temporarily multiplies the level speed by the provided factor More...
 
virtual bool CheckRecycleCondition (Bounds objectBounds, float destroyDistance)
 Determines if the object whose bounds are passed as a parameter has to be recycled or not. More...
 
virtual bool CheckDeathCondition (Bounds objectBounds)
 
virtual void GotoLevel (string levelName)
 Gets the player to the specified level More...
 
virtual void GameOverAction ()
 Triggered when all lives are lost and you press the main action button More...
 
virtual void LifeLostAction ()
 Triggered when a life is lost and you press the main action button More...
 
virtual void KillCharacter (PlayableCharacter player)
 Kills the player. More...
 

Public Attributes

GameObject StartingPosition
 the prefab you want for your player More...
 
List< PlayableCharacterPlayableCharacters
 the list of playable characters - use this to tell what characters you want in your level, don't access that at runtime More...
 
float DistanceBetweenCharacters = 1f
 the x distance between each character More...
 
float PointsPerSecond = 20
 the amount of points a player gets per second More...
 
String InstructionsText
 the text that will be shown (if not empty) at the start of the level More...
 
Bounds RecycleBounds
 the line after which objects can be recycled More...
 
Bounds DeathBounds
 the line after which playable characters will die - leave it to zero if you don't want to use it More...
 
float InitialSpeed = 10f
 the initial speed of the level More...
 
float MaximumSpeed = 50f
 the maximum speed the level will run at More...
 
float SpeedAcceleration =1f
 the acceleration (per second) at which the level will go from InitialSpeed to MaximumSpeed More...
 
float IntroFadeDuration =1f
 duration of the initial fade in More...
 
float OutroFadeDuration =1f
 duration of the fade to black at the end of the level More...
 
int StartCountdown
 the duration (in seconds) of the initial countdown More...
 
string StartText
 the text displayed at the end of the countdown More...
 
Controls ControlScheme
 the mobile control scheme applied to this level More...
 
GameObject LifeLostExplosion
 the effect we instantiate when a life is lost More...
 

Protected Member Functions

virtual void Start ()
 Initialization More...
 
virtual void PrepareStart ()
 Handles everything before the actual start of the game. More...
 
virtual IEnumerator PrepareStartCountdown ()
 Handles the initial start countdown display More...
 
virtual void InstantiateCharacters ()
 Instantiates all the playable characters and feeds them to the gameManager More...
 
virtual void ManageControlScheme ()
 Turns buttons on or off depending on the chosen mobile control scheme More...
 
virtual void HandleSpeedFactor ()
 Called every frame, this modified the current level speed if we're under the effect of a speed factor More...
 
virtual IEnumerator GotoLevelCo (string levelName)
 Waits for a short time and then loads the specified level More...
 
virtual IEnumerator KillCharacterCo (PlayableCharacter player)
 Coroutine that kills the player, stops the camera, resets the points. More...
 
virtual void AllCharactersAreDead ()
 What happens when all characters are dead (or when the character is dead if you only have one) More...
 
virtual void OnEnable ()
 Override this if needed More...
 
virtual void OnDisable ()
 Override this if needed More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< LevelManager >
virtual void Awake ()
 On awake, we initialize our instance. Make sure to call base.Awake() in override if you need awake. More...
 

Protected Attributes

DateTime _started
 
float _savedPoints
 
float _recycleX
 
Bounds _tmpRecycleBounds
 
bool _temporarySpeedFactorActive
 
float _temporarySpeedFactor
 
float _temporarySpeedFactorRemainingTime
 
float _temporarySavedSpeed
 

Properties

float Speed [getprotected set]
 The current speed the level is traveling at. More...
 
float DistanceTraveled [getprotected set]
 The distance traveled since the start of the level. More...
 
List< PlayableCharacterCurrentPlayableCharacters [getset]
 the list of playable characters currently instantiated in the game - use this to know what characters ARE currently in your level at runtime More...
 
float RunningTime [getprotected set]
 the elapsed time since the start of the level More...
 
- Properties inherited from MoreMountains.Tools.MMSingleton< LevelManager >
static bool HasInstance [get]
 
static T Current [get]
 
static T Instance [get]
 Singleton design pattern More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< LevelManager >
static T TryGetInstance ()
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< LevelManager >
static T _instance
 

Detailed Description

Spawns the player, and

Member Enumeration Documentation

◆ Controls

Enumerator
SingleButton 
LeftRight 
Swipe 

Member Function Documentation

◆ AddSpeed()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.AddSpeed ( float  speedAdded)
virtual

Adds speed to the current level speed

Parameters
speedAddedSpeed added.

◆ AllCharactersAreDead()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.AllCharactersAreDead ( )
protectedvirtual

What happens when all characters are dead (or when the character is dead if you only have one)

Reimplemented in MoreMountains.InfiniteRunnerEngine.SkyTheoryLevelManager.

◆ CheckDeathCondition()

virtual bool MoreMountains.InfiniteRunnerEngine.LevelManager.CheckDeathCondition ( Bounds  objectBounds)
virtual

◆ CheckRecycleCondition()

virtual bool MoreMountains.InfiniteRunnerEngine.LevelManager.CheckRecycleCondition ( Bounds  objectBounds,
float  destroyDistance 
)
virtual

Determines if the object whose bounds are passed as a parameter has to be recycled or not.

Returns
true, if the object has to be recycled, false otherwise.
Parameters
objectBoundsObject bounds.
destroyDistanceThe x distance after which the object will get destroyed.

◆ GameOverAction()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.GameOverAction ( )
virtual

Triggered when all lives are lost and you press the main action button

◆ GotoLevel()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.GotoLevel ( string  levelName)
virtual

Gets the player to the specified level

Parameters
levelNameLevel name.

◆ GotoLevelCo()

virtual IEnumerator MoreMountains.InfiniteRunnerEngine.LevelManager.GotoLevelCo ( string  levelName)
protectedvirtual

Waits for a short time and then loads the specified level

Returns
The level co.
Parameters
levelNameLevel name.

◆ HandleSpeedFactor()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.HandleSpeedFactor ( )
protectedvirtual

Called every frame, this modified the current level speed if we're under the effect of a speed factor

◆ InstantiateCharacters()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.InstantiateCharacters ( )
protectedvirtual

Instantiates all the playable characters and feeds them to the gameManager

we go through the list of playable characters and instantiate them while adding them to the list we'll use from any class to access the currently playable characters

Reimplemented in MoreMountains.InfiniteRunnerEngine.SkyTheoryLevelManager.

◆ KillCharacter()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.KillCharacter ( PlayableCharacter  player)
virtual

Kills the player.

◆ KillCharacterCo()

virtual IEnumerator MoreMountains.InfiniteRunnerEngine.LevelManager.KillCharacterCo ( PlayableCharacter  player)
protectedvirtual

Coroutine that kills the player, stops the camera, resets the points.

Returns
The player co.

◆ LevelStart()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.LevelStart ( )
virtual

Handles the start of the level : starts the autoincrementation of the score, sets the proper status and triggers the corresponding event.

Reimplemented in MoreMountains.InfiniteRunnerEngine.SkyTheoryLevelManager.

◆ LifeLostAction()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.LifeLostAction ( )
virtual

Triggered when a life is lost and you press the main action button

◆ ManageControlScheme()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.ManageControlScheme ( )
protectedvirtual

Turns buttons on or off depending on the chosen mobile control scheme

Reimplemented in MoreMountains.InfiniteRunnerEngine.SkyTheoryLevelManager.

◆ OnDisable()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.OnDisable ( )
protectedvirtual

Override this if needed

◆ OnEnable()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.OnEnable ( )
protectedvirtual

Override this if needed

◆ PrepareStart()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.PrepareStart ( )
protectedvirtual

Handles everything before the actual start of the game.

◆ PrepareStartCountdown()

virtual IEnumerator MoreMountains.InfiniteRunnerEngine.LevelManager.PrepareStartCountdown ( )
protectedvirtual

Handles the initial start countdown display

Returns
The start countdown.

◆ ResetLevel()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.ResetLevel ( )
virtual

Resets the level : repops dead characters, sets everything up for a new game

Reimplemented in MoreMountains.InfiniteRunnerEngine.SkyTheoryLevelManager.

◆ SetSpeed()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.SetSpeed ( float  newSpeed)
virtual

Sets the speed.

Parameters
newSpeedNew speed.

◆ Start()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.Start ( )
protectedvirtual

◆ TemporarilyMultiplySpeed()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.TemporarilyMultiplySpeed ( float  factor,
float  duration 
)
virtual

Temporarily multiplies the level speed by the provided factor

Parameters
factorThe number of times you want to increase/decrease the speed by.
durationThe duration of the speed change, in seconds.

◆ Update()

virtual void MoreMountains.InfiniteRunnerEngine.LevelManager.Update ( )
virtual

Member Data Documentation

◆ _recycleX

float MoreMountains.InfiniteRunnerEngine.LevelManager._recycleX
protected

◆ _savedPoints

float MoreMountains.InfiniteRunnerEngine.LevelManager._savedPoints
protected

◆ _started

DateTime MoreMountains.InfiniteRunnerEngine.LevelManager._started
protected

◆ _temporarySavedSpeed

float MoreMountains.InfiniteRunnerEngine.LevelManager._temporarySavedSpeed
protected

◆ _temporarySpeedFactor

float MoreMountains.InfiniteRunnerEngine.LevelManager._temporarySpeedFactor
protected

◆ _temporarySpeedFactorActive

bool MoreMountains.InfiniteRunnerEngine.LevelManager._temporarySpeedFactorActive
protected

◆ _temporarySpeedFactorRemainingTime

float MoreMountains.InfiniteRunnerEngine.LevelManager._temporarySpeedFactorRemainingTime
protected

◆ _tmpRecycleBounds

Bounds MoreMountains.InfiniteRunnerEngine.LevelManager._tmpRecycleBounds
protected

◆ ControlScheme

Controls MoreMountains.InfiniteRunnerEngine.LevelManager.ControlScheme

the mobile control scheme applied to this level

◆ DeathBounds

Bounds MoreMountains.InfiniteRunnerEngine.LevelManager.DeathBounds

the line after which playable characters will die - leave it to zero if you don't want to use it

◆ DistanceBetweenCharacters

float MoreMountains.InfiniteRunnerEngine.LevelManager.DistanceBetweenCharacters = 1f

the x distance between each character

◆ InitialSpeed

float MoreMountains.InfiniteRunnerEngine.LevelManager.InitialSpeed = 10f

the initial speed of the level

◆ InstructionsText

String MoreMountains.InfiniteRunnerEngine.LevelManager.InstructionsText

the text that will be shown (if not empty) at the start of the level

◆ IntroFadeDuration

float MoreMountains.InfiniteRunnerEngine.LevelManager.IntroFadeDuration =1f

duration of the initial fade in

◆ LifeLostExplosion

GameObject MoreMountains.InfiniteRunnerEngine.LevelManager.LifeLostExplosion

the effect we instantiate when a life is lost

◆ MaximumSpeed

float MoreMountains.InfiniteRunnerEngine.LevelManager.MaximumSpeed = 50f

the maximum speed the level will run at

◆ OutroFadeDuration

float MoreMountains.InfiniteRunnerEngine.LevelManager.OutroFadeDuration =1f

duration of the fade to black at the end of the level

◆ PlayableCharacters

List<PlayableCharacter> MoreMountains.InfiniteRunnerEngine.LevelManager.PlayableCharacters

the list of playable characters - use this to tell what characters you want in your level, don't access that at runtime

◆ PointsPerSecond

float MoreMountains.InfiniteRunnerEngine.LevelManager.PointsPerSecond = 20

the amount of points a player gets per second

◆ RecycleBounds

Bounds MoreMountains.InfiniteRunnerEngine.LevelManager.RecycleBounds

the line after which objects can be recycled

◆ SpeedAcceleration

float MoreMountains.InfiniteRunnerEngine.LevelManager.SpeedAcceleration =1f

the acceleration (per second) at which the level will go from InitialSpeed to MaximumSpeed

◆ StartCountdown

int MoreMountains.InfiniteRunnerEngine.LevelManager.StartCountdown

the duration (in seconds) of the initial countdown

◆ StartingPosition

GameObject MoreMountains.InfiniteRunnerEngine.LevelManager.StartingPosition

the prefab you want for your player

◆ StartText

string MoreMountains.InfiniteRunnerEngine.LevelManager.StartText

the text displayed at the end of the countdown

Property Documentation

◆ CurrentPlayableCharacters

List<PlayableCharacter> MoreMountains.InfiniteRunnerEngine.LevelManager.CurrentPlayableCharacters
getset

the list of playable characters currently instantiated in the game - use this to know what characters ARE currently in your level at runtime

◆ DistanceTraveled

float MoreMountains.InfiniteRunnerEngine.LevelManager.DistanceTraveled
getprotected set

The distance traveled since the start of the level.

◆ RunningTime

float MoreMountains.InfiniteRunnerEngine.LevelManager.RunningTime
getprotected set

the elapsed time since the start of the level

◆ Speed

float MoreMountains.InfiniteRunnerEngine.LevelManager.Speed
getprotected set

The current speed the level is traveling at.


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