Corgi Engine
v9.0
|
Spawns the player, handles checkpoints and respawn More...
Public Types | |
enum | CheckpointsAxis { CheckpointsAxis.x, CheckpointsAxis.y, CheckpointsAxis.z, CheckpointsAxis.CheckpointOrder } |
the possible checkpoint axis More... | |
enum | CheckpointDirections { CheckpointDirections.Ascending, CheckpointDirections.Descending } |
enum | BoundsModes { BoundsModes.TwoD, BoundsModes.ThreeD } |
Public Member Functions | |
virtual void | Start () |
Initialization More... | |
virtual void | SetCurrentCheckpoint (CheckPoint newCheckPoint) |
Sets the current checkpoint. More... | |
virtual void | SetNextLevel (string levelName) |
Sets the name of the next level this LevelManager will point to More... | |
virtual void | GotoNextLevel () |
Loads the next level, as defined via the SetNextLevel method More... | |
virtual void | GotoLevel (string levelName, bool fadeOut=true, bool save=true) |
Gets the player to the specified level More... | |
virtual void | PlayerDead (Character player) |
Kills the player. More... | |
virtual void | FreezeCharacters () |
Freezes the character(s) More... | |
virtual void | UnFreezeCharacters () |
Unfreezes the character(s) More... | |
virtual void | ToggleCharacterPause () |
Toggles Character Pause More... | |
virtual void | ResetLevelBoundsToOriginalBounds () |
Resets the level bounds to their initial value More... | |
virtual void | SetNewMinLevelBounds (Vector3 newMinBounds) |
Sets the level bound's min point to the one in parameters More... | |
virtual void | SetNewMaxLevelBounds (Vector3 newMaxBounds) |
Sets the level bound's max point to the one in parameters More... | |
virtual void | SetNewLevelBounds (Bounds newBounds) |
Sets the level bounds to the one passed in parameters More... | |
virtual void | OnMMEvent (CorgiEngineEvent engineEvent) |
Catches CorgiEngineEvents and acts on them, playing the corresponding sounds More... | |
Public Member Functions inherited from MoreMountains.Tools.MMEventListener< CorgiEngineEvent > | |
void | OnMMEvent (T eventType) |
Public Attributes | |
Character[] | PlayerPrefabs |
the prefab you want for your player More... | |
bool | AutoAttributePlayerIDs = true |
should the player IDs be auto attributed (usually yes) More... | |
List< Character > | SceneCharacters |
a list of Characters already present in the scene before runtime. If this list is filled, PlayerPrefabs will be ignored More... | |
CheckPoint | DebugSpawn |
A checkpoint to use to force the character to spawn at. More... | |
CheckpointsAxis | CheckpointAttributionAxis = CheckpointsAxis.x |
the axis on which objects should be compared More... | |
CheckpointDirections | CheckpointAttributionDirection = CheckpointDirections.Ascending |
the direction in which checkpoint order should be determined More... | |
CheckPoint | CurrentCheckPoint |
the current checkpoint More... | |
List< PointOfEntry > | PointsOfEntry |
a list of all the points of entry for this level More... | |
float | IntroFadeDuration =1f |
duration of the initial fade in (in seconds) More... | |
float | OutroFadeDuration =1f |
duration of the fade to black at the end of the level (in seconds) More... | |
int | FaderID = 0 |
the ID to use when triggering the event (should match the ID on the fader you want to use) More... | |
MMTweenType | FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInOutCubic) |
the curve to use for in and out fades More... | |
float | RespawnDelay = 2f |
duration between a death of the main character and its respawn More... | |
bool | ResetPointsOnRestart = true |
if this is true, points will be reset when this level restarts - usually after a player's death More... | |
BoundsModes | BoundsMode = BoundsModes.ThreeD |
whether to use a 3D or 2D collider as level bounds, this will be used by Cinemachine confiners More... | |
Bounds | LevelBounds = new Bounds(Vector3.zero,Vector3.one*10) |
the level limits, camera and player won't go beyond this point. More... | |
bool | ConvertToColliderBoundsButton |
MMLoadScene.LoadingSceneModes | LoadingSceneMode = MMLoadScene.LoadingSceneModes.MMSceneLoadingManager |
the method to use to load the destination level More... | |
string | LoadingSceneName = "LoadingScreen" |
the name of the MMSceneLoadingManager scene you want to use More... | |
MMAdditiveSceneLoadingManagerSettings | AdditiveLoadingSettings |
the settings to use when loading the scene in additive mode More... | |
bool | SetPlayerAsFeedbackRangeCenter = false |
if this is true, an event will be triggered on player instantiation to set the range target of all feedbacks to it More... | |
Protected Member Functions | |
override void | Awake () |
On awake, instantiates the player More... | |
virtual void | InstantiatePlayableCharacters () |
Instantiate playable characters based on the ones specified in the PlayerPrefabs list in the LevelManager's inspector. More... | |
virtual void | Initialization () |
Gets current camera, points number, start time, etc. More... | |
virtual void | CheckpointAssignment () |
Assigns all respawnable objects in the scene to their checkpoint More... | |
virtual void | LevelGUIStart () |
Initializes GUI stuff More... | |
virtual void | SpawnSingleCharacter () |
Spawns a playable character into the scene More... | |
virtual void | RegularSpawnSingleCharacter () |
Spawns the character at the selected entry point if there's one, or at the selected checkpoint. More... | |
virtual void | SpawnMultipleCharacters () |
Spawns multiple playable characters into the scene More... | |
virtual IEnumerator | GotoLevelCo (string levelName, bool fadeOut=true) |
Waits for a short time and then loads the specified level More... | |
virtual void | LoadScene (string destinationScene) |
virtual void | Cleanup () |
Resets lives, removes persistent characters and stored ones if needed More... | |
virtual IEnumerator | SoloModeRestart () |
Coroutine that kills the player, stops the camera, resets the points. More... | |
virtual void | UpdateBoundsCollider () |
Updates the level collider's bounds for Cinemachine (and others that may use it) More... | |
virtual void | GenerateColliderBounds () |
A temporary method used to convert level bounds from the old system to actual collider bounds More... | |
virtual void | OnEnable () |
OnDisable, we start listening to events. More... | |
virtual void | OnDisable () |
OnDisable, we stop listening to events. More... | |
Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< LevelManager > | |
virtual void | InitializeSingleton () |
Initializes the singleton. More... | |
Static Protected Member Functions | |
static void | InitializeStatics () |
Statics initialization to support enter play modes More... | |
Protected Attributes | |
DateTime | _started |
int | _savedPoints |
string | _nextLevel = null |
BoxCollider | _collider |
BoxCollider2D | _collider2D |
Bounds | _originalBounds |
Properties | |
Collider | BoundsCollider [get, protected set] |
Collider2D | BoundsCollider2D [get, protected set] |
virtual TimeSpan | RunningTime [get] |
the elapsed time since the start of the level More... | |
virtual CameraController | LevelCameraController [get, set] |
virtual List< Character > | Players [get, protected set] |
virtual List< CheckPoint > | Checkpoints [get, protected set] |
Properties inherited from MoreMountains.Tools.MMSingleton< LevelManager > | |
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 Public Attributes inherited from MoreMountains.Tools.MMSingleton< LevelManager > | |
static bool | HasInstance |
static T | Current |
Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< LevelManager > | |
static T | _instance |
Spawns the player, handles checkpoints and respawn
|
protectedvirtual |
On awake, instantiates the player
Reimplemented from MoreMountains.Tools.MMSingleton< LevelManager >.
|
protectedvirtual |
Assigns all respawnable objects in the scene to their checkpoint
|
protectedvirtual |
Resets lives, removes persistent characters and stored ones if needed
|
virtual |
Freezes the character(s)
|
protectedvirtual |
A temporary method used to convert level bounds from the old system to actual collider bounds
|
virtual |
Gets the player to the specified level
levelName | Level name. |
|
protectedvirtual |
Waits for a short time and then loads the specified level
levelName | Level name. |
|
virtual |
Loads the next level, as defined via the SetNextLevel method
|
protectedvirtual |
Gets current camera, points number, start time, etc.
|
staticprotected |
Statics initialization to support enter play modes
|
protectedvirtual |
Instantiate playable characters based on the ones specified in the PlayerPrefabs list in the LevelManager's inspector.
|
protectedvirtual |
Initializes GUI stuff
|
protectedvirtual |
|
protectedvirtual |
OnDisable, we stop listening to events.
|
protectedvirtual |
OnDisable, we start listening to events.
|
virtual |
Catches CorgiEngineEvents and acts on them, playing the corresponding sounds
engineEvent | CorgiEngineEvent event. |
|
virtual |
Kills the player.
Reimplemented in MoreMountains.CorgiEngine.MultiplayerLevelManager.
|
protectedvirtual |
Spawns the character at the selected entry point if there's one, or at the selected checkpoint.
|
virtual |
Resets the level bounds to their initial value
|
virtual |
Sets the current checkpoint.
newCheckPoint | New check point. |
|
virtual |
Sets the level bounds to the one passed in parameters
newBounds |
|
virtual |
Sets the level bound's max point to the one in parameters
newMaxBounds |
|
virtual |
Sets the level bound's min point to the one in parameters
|
virtual |
Sets the name of the next level this LevelManager will point to
levelName |
|
protectedvirtual |
Coroutine that kills the player, stops the camera, resets the points.
|
protectedvirtual |
Spawns multiple playable characters into the scene
|
protectedvirtual |
Spawns a playable character into the scene
|
virtual |
Initialization
|
virtual |
Toggles Character Pause
|
virtual |
Unfreezes the character(s)
|
protectedvirtual |
Updates the level collider's bounds for Cinemachine (and others that may use it)
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
MMAdditiveSceneLoadingManagerSettings MoreMountains.CorgiEngine.LevelManager.AdditiveLoadingSettings |
the settings to use when loading the scene in additive mode
bool MoreMountains.CorgiEngine.LevelManager.AutoAttributePlayerIDs = true |
should the player IDs be auto attributed (usually yes)
BoundsModes MoreMountains.CorgiEngine.LevelManager.BoundsMode = BoundsModes.ThreeD |
whether to use a 3D or 2D collider as level bounds, this will be used by Cinemachine confiners
CheckpointsAxis MoreMountains.CorgiEngine.LevelManager.CheckpointAttributionAxis = CheckpointsAxis.x |
the axis on which objects should be compared
CheckpointDirections MoreMountains.CorgiEngine.LevelManager.CheckpointAttributionDirection = CheckpointDirections.Ascending |
the direction in which checkpoint order should be determined
bool MoreMountains.CorgiEngine.LevelManager.ConvertToColliderBoundsButton |
CheckPoint MoreMountains.CorgiEngine.LevelManager.CurrentCheckPoint |
the current checkpoint
CheckPoint MoreMountains.CorgiEngine.LevelManager.DebugSpawn |
A checkpoint to use to force the character to spawn at.
int MoreMountains.CorgiEngine.LevelManager.FaderID = 0 |
the ID to use when triggering the event (should match the ID on the fader you want to use)
MMTweenType MoreMountains.CorgiEngine.LevelManager.FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInOutCubic) |
the curve to use for in and out fades
float MoreMountains.CorgiEngine.LevelManager.IntroFadeDuration =1f |
duration of the initial fade in (in seconds)
Bounds MoreMountains.CorgiEngine.LevelManager.LevelBounds = new Bounds(Vector3.zero,Vector3.one*10) |
the level limits, camera and player won't go beyond this point.
MMLoadScene.LoadingSceneModes MoreMountains.CorgiEngine.LevelManager.LoadingSceneMode = MMLoadScene.LoadingSceneModes.MMSceneLoadingManager |
the method to use to load the destination level
string MoreMountains.CorgiEngine.LevelManager.LoadingSceneName = "LoadingScreen" |
the name of the MMSceneLoadingManager scene you want to use
float MoreMountains.CorgiEngine.LevelManager.OutroFadeDuration =1f |
duration of the fade to black at the end of the level (in seconds)
Character [] MoreMountains.CorgiEngine.LevelManager.PlayerPrefabs |
the prefab you want for your player
the list of player prefabs to instantiate
List<PointOfEntry> MoreMountains.CorgiEngine.LevelManager.PointsOfEntry |
a list of all the points of entry for this level
bool MoreMountains.CorgiEngine.LevelManager.ResetPointsOnRestart = true |
if this is true, points will be reset when this level restarts - usually after a player's death
float MoreMountains.CorgiEngine.LevelManager.RespawnDelay = 2f |
duration between a death of the main character and its respawn
List<Character> MoreMountains.CorgiEngine.LevelManager.SceneCharacters |
a list of Characters already present in the scene before runtime. If this list is filled, PlayerPrefabs will be ignored
bool MoreMountains.CorgiEngine.LevelManager.SetPlayerAsFeedbackRangeCenter = false |
if this is true, an event will be triggered on player instantiation to set the range target of all feedbacks to it
|
getprotected set |
|
getprotected set |
|
getprotected set |
|
getset |
|
getprotected set |
|
get |
the elapsed time since the start of the level