Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMAdditiveSceneLoadingManager Class Reference

A class to load scenes using a loading screen instead of just the default API This is a new version of the classic LoadingSceneManager (now renamed to MMSceneLoadingManager for consistency) More...

Inheritance diagram for MoreMountains.Tools.MMAdditiveSceneLoadingManager:
MoreMountains.Tools.MMMonoBehaviour

Public Types

enum  FadeModes { FadeModes.FadeInThenOut, FadeModes.FadeOutThenIn }
 The possible orders in which to play fades (depends on the fade you've set in your loading screen. More...
 

Static Public Member Functions

static void LoadScene (string sceneToLoadName, MMAdditiveSceneLoadingManagerSettings settings)
 Call this static method to load a scene from anywhere (packed settings signature) More...
 
static void LoadScene (string sceneToLoadName, string loadingSceneName="MMAdditiveLoadingScreen", ThreadPriority threadPriority=ThreadPriority.High, bool secureLoad=true, bool interpolateProgress=true, float beforeEntryFadeDelay=0f, float entryFadeDuration=0.25f, float afterEntryFadeDelay=0.1f, float beforeExitFadeDelay=0.25f, float exitFadeDuration=0.2f, MMTweenType entryFadeTween=null, MMTweenType exitFadeTween=null, float progressBarSpeed=5f, FadeModes fadeMode=FadeModes.FadeInThenOut, MMAdditiveSceneLoadingManagerSettings.UnloadMethods unloadMethod=MMAdditiveSceneLoadingManagerSettings.UnloadMethods.AllScenes, string antiSpillSceneName="", List< MMSceneLoadingSpeedInterval > speedIntervals=null)
 Call this static method to load a scene from anywhere More...
 
static float ComputeInterpolationSpeed (float t)
 Computes the interpolation speed to apply for a specific progress time More...
 

Public Attributes

AudioListener LoadingAudioListener
 
int FaderID = 500
 the ID on which to trigger a fade, has to match the ID on the fader in your scene More...
 
bool DebugMode = false
 whether or not to output debug messages to the console More...
 
ProgressEvent SetRealtimeProgressValue
 an event used to update progress More...
 
ProgressEvent SetInterpolatedProgressValue
 an event used to update progress with interpolation More...
 
UnityEvent OnLoadStarted
 an event that will be invoked when the load starts More...
 
UnityEvent OnBeforeEntryFade
 an event that will be invoked when the delay before the entry fade starts More...
 
UnityEvent OnEntryFade
 an event that will be invoked when the entry fade starts More...
 
UnityEvent OnAfterEntryFade
 an event that will be invoked when the delay after the entry fade starts More...
 
UnityEvent OnUnloadOriginScene
 an event that will be invoked when the origin scene gets unloaded More...
 
UnityEvent OnLoadDestinationScene
 an event that will be invoked when the destination scene starts loading More...
 
UnityEvent OnLoadProgressComplete
 an event that will be invoked when the load of the destination scene is complete More...
 
UnityEvent OnInterpolatedLoadProgressComplete
 an event that will be invoked when the interpolated load of the destination scene is complete More...
 
UnityEvent OnBeforeExitFade
 an event that will be invoked when the delay before the exit fade starts More...
 
UnityEvent OnExitFade
 an event that will be invoked when the exit fade starts More...
 
UnityEvent OnDestinationSceneActivation
 an event that will be invoked when the destination scene gets activated More...
 
UnityEvent OnUnloadSceneLoader
 an event that will be invoked when the scene loader gets unloaded More...
 

Protected Member Functions

virtual void Awake ()
 Starts loading the new level asynchronously More...
 
virtual void Initialization ()
 Initializes timescale, computes null checks, and starts the load sequence More...
 
virtual void Update ()
 Every frame, we fill the bar smoothly according to loading progress More...
 
virtual void UpdateProgress ()
 Sends progress value via UnityEvents More...
 
virtual IEnumerator LoadSequence ()
 Loads the scene to load asynchronously. More...
 
virtual void InitiateLoad ()
 Initializes counters and timescale More...
 
virtual IEnumerator ProcessDelayBeforeEntryFade ()
 Waits for the specified BeforeEntryFadeDelay duration More...
 
virtual IEnumerator EntryFade ()
 Calls a fader on entry More...
 
virtual IEnumerator ProcessDelayAfterEntryFade ()
 Waits for the specified AfterEntryFadeDelay More...
 
virtual IEnumerator UnloadOriginScenes ()
 Unloads the original scene(s) and waits for the unload to complete More...
 
virtual IEnumerator LoadDestinationScene ()
 Loads the destination scene More...
 
virtual IEnumerator ProcessDelayBeforeExitFade ()
 Waits for BeforeExitFadeDelay seconds More...
 
virtual IEnumerator ExitFade ()
 Requests a fade on exit More...
 
virtual IEnumerator DestinationSceneActivation ()
 Activates the destination scene More...
 
virtual void OnLoadOperationComplete (AsyncOperation obj)
 A method triggered when the async operation completes More...
 
virtual IEnumerator UnloadSceneLoader ()
 Unloads the scene loader More...
 
virtual void SetAudioListener (bool state)
 Turns the loading audio listener on or off More...
 
virtual void OnDestroy ()
 On Destroy we reset our state More...
 
virtual void MMLoadingSceneDebug (string message)
 A debug method used to output console messages, for this class only More...
 

Protected Attributes

float _loadProgress = 0f
 
float _interpolatedLoadProgress
 
AsyncOperation _unloadOriginAsyncOperation
 
AsyncOperation _loadDestinationAsyncOperation
 
AsyncOperation _unloadLoadingAsyncOperation
 
bool _setRealtimeProgressValueIsNull
 
bool _setInterpolatedProgressValueIsNull
 
MMSceneLoadingAntiSpill _antiSpill = new MMSceneLoadingAntiSpill()
 

Static Protected Attributes

static bool _interpolateProgress
 
static float _progressInterpolationSpeed
 
static List< MMSceneLoadingSpeedInterval_speedIntervals
 
static float _beforeEntryFadeDelay
 
static MMTweenType _entryFadeTween
 
static float _entryFadeDuration
 
static float _afterEntryFadeDelay
 
static float _beforeExitFadeDelay
 
static MMTweenType _exitFadeTween
 
static float _exitFadeDuration
 
static FadeModes _fadeMode
 
static string _sceneToLoadName = ""
 
static string _loadingScreenSceneName
 
static List< string > _scenesInBuild
 
static Scene[] _initialScenes
 
static bool _loadingInProgress = false
 
const float _asyncProgressLimit = 0.9f
 
static string _antiSpillSceneName = ""
 

Detailed Description

A class to load scenes using a loading screen instead of just the default API This is a new version of the classic LoadingSceneManager (now renamed to MMSceneLoadingManager for consistency)

Member Enumeration Documentation

◆ FadeModes

The possible orders in which to play fades (depends on the fade you've set in your loading screen.

Enumerator
FadeInThenOut 
FadeOutThenIn 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.Awake ( )
protectedvirtual

Starts loading the new level asynchronously

◆ ComputeInterpolationSpeed()

static float MoreMountains.Tools.MMAdditiveSceneLoadingManager.ComputeInterpolationSpeed ( float  t)
static

Computes the interpolation speed to apply for a specific progress time

Parameters
t
Returns

◆ DestinationSceneActivation()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.DestinationSceneActivation ( )
protectedvirtual

Activates the destination scene

◆ EntryFade()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.EntryFade ( )
protectedvirtual

Calls a fader on entry

Returns

◆ ExitFade()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.ExitFade ( )
protectedvirtual

Requests a fade on exit

Returns

◆ Initialization()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.Initialization ( )
protectedvirtual

Initializes timescale, computes null checks, and starts the load sequence

◆ InitiateLoad()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.InitiateLoad ( )
protectedvirtual

Initializes counters and timescale

◆ LoadDestinationScene()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.LoadDestinationScene ( )
protectedvirtual

Loads the destination scene

Returns

◆ LoadScene() [1/2]

static void MoreMountains.Tools.MMAdditiveSceneLoadingManager.LoadScene ( string  sceneToLoadName,
MMAdditiveSceneLoadingManagerSettings  settings 
)
static

Call this static method to load a scene from anywhere (packed settings signature)

Parameters
sceneToLoadName
settings

◆ LoadScene() [2/2]

static void MoreMountains.Tools.MMAdditiveSceneLoadingManager.LoadScene ( string  sceneToLoadName,
string  loadingSceneName = "MMAdditiveLoadingScreen",
ThreadPriority  threadPriority = ThreadPriority.High,
bool  secureLoad = true,
bool  interpolateProgress = true,
float  beforeEntryFadeDelay = 0f,
float  entryFadeDuration = 0.25f,
float  afterEntryFadeDelay = 0.1f,
float  beforeExitFadeDelay = 0.25f,
float  exitFadeDuration = 0.2f,
MMTweenType  entryFadeTween = null,
MMTweenType  exitFadeTween = null,
float  progressBarSpeed = 5f,
FadeModes  fadeMode = FadeModes.FadeInThenOut,
MMAdditiveSceneLoadingManagerSettings.UnloadMethods  unloadMethod = MMAdditiveSceneLoadingManagerSettings.UnloadMethods.AllScenes,
string  antiSpillSceneName = "",
List< MMSceneLoadingSpeedInterval speedIntervals = null 
)
static

Call this static method to load a scene from anywhere

Parameters
sceneToLoadNameLevel name.

◆ LoadSequence()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.LoadSequence ( )
protectedvirtual

Loads the scene to load asynchronously.

◆ MMLoadingSceneDebug()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.MMLoadingSceneDebug ( string  message)
protectedvirtual

A debug method used to output console messages, for this class only

Parameters
message

◆ OnDestroy()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnDestroy ( )
protectedvirtual

On Destroy we reset our state

◆ OnLoadOperationComplete()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnLoadOperationComplete ( AsyncOperation  obj)
protectedvirtual

A method triggered when the async operation completes

Parameters
obj

◆ ProcessDelayAfterEntryFade()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.ProcessDelayAfterEntryFade ( )
protectedvirtual

Waits for the specified AfterEntryFadeDelay

Returns

◆ ProcessDelayBeforeEntryFade()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.ProcessDelayBeforeEntryFade ( )
protectedvirtual

Waits for the specified BeforeEntryFadeDelay duration

Returns

◆ ProcessDelayBeforeExitFade()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.ProcessDelayBeforeExitFade ( )
protectedvirtual

Waits for BeforeExitFadeDelay seconds

Returns

◆ SetAudioListener()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.SetAudioListener ( bool  state)
protectedvirtual

Turns the loading audio listener on or off

Parameters
state

◆ UnloadOriginScenes()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.UnloadOriginScenes ( )
protectedvirtual

Unloads the original scene(s) and waits for the unload to complete

Returns

◆ UnloadSceneLoader()

virtual IEnumerator MoreMountains.Tools.MMAdditiveSceneLoadingManager.UnloadSceneLoader ( )
protectedvirtual

Unloads the scene loader

Returns

◆ Update()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.Update ( )
protectedvirtual

Every frame, we fill the bar smoothly according to loading progress

◆ UpdateProgress()

virtual void MoreMountains.Tools.MMAdditiveSceneLoadingManager.UpdateProgress ( )
protectedvirtual

Sends progress value via UnityEvents

Member Data Documentation

◆ _afterEntryFadeDelay

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._afterEntryFadeDelay
staticprotected

◆ _antiSpill

MMSceneLoadingAntiSpill MoreMountains.Tools.MMAdditiveSceneLoadingManager._antiSpill = new MMSceneLoadingAntiSpill()
protected

◆ _antiSpillSceneName

string MoreMountains.Tools.MMAdditiveSceneLoadingManager._antiSpillSceneName = ""
staticprotected

◆ _asyncProgressLimit

const float MoreMountains.Tools.MMAdditiveSceneLoadingManager._asyncProgressLimit = 0.9f
staticprotected

◆ _beforeEntryFadeDelay

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._beforeEntryFadeDelay
staticprotected

◆ _beforeExitFadeDelay

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._beforeExitFadeDelay
staticprotected

◆ _entryFadeDuration

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._entryFadeDuration
staticprotected

◆ _entryFadeTween

MMTweenType MoreMountains.Tools.MMAdditiveSceneLoadingManager._entryFadeTween
staticprotected

◆ _exitFadeDuration

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._exitFadeDuration
staticprotected

◆ _exitFadeTween

MMTweenType MoreMountains.Tools.MMAdditiveSceneLoadingManager._exitFadeTween
staticprotected

◆ _fadeMode

FadeModes MoreMountains.Tools.MMAdditiveSceneLoadingManager._fadeMode
staticprotected

◆ _initialScenes

Scene [] MoreMountains.Tools.MMAdditiveSceneLoadingManager._initialScenes
staticprotected

◆ _interpolatedLoadProgress

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._interpolatedLoadProgress
protected

◆ _interpolateProgress

bool MoreMountains.Tools.MMAdditiveSceneLoadingManager._interpolateProgress
staticprotected

◆ _loadDestinationAsyncOperation

AsyncOperation MoreMountains.Tools.MMAdditiveSceneLoadingManager._loadDestinationAsyncOperation
protected

◆ _loadingInProgress

bool MoreMountains.Tools.MMAdditiveSceneLoadingManager._loadingInProgress = false
staticprotected

◆ _loadingScreenSceneName

string MoreMountains.Tools.MMAdditiveSceneLoadingManager._loadingScreenSceneName
staticprotected

◆ _loadProgress

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._loadProgress = 0f
protected

◆ _progressInterpolationSpeed

float MoreMountains.Tools.MMAdditiveSceneLoadingManager._progressInterpolationSpeed
staticprotected

◆ _scenesInBuild

List<string> MoreMountains.Tools.MMAdditiveSceneLoadingManager._scenesInBuild
staticprotected

◆ _sceneToLoadName

string MoreMountains.Tools.MMAdditiveSceneLoadingManager._sceneToLoadName = ""
staticprotected

◆ _setInterpolatedProgressValueIsNull

bool MoreMountains.Tools.MMAdditiveSceneLoadingManager._setInterpolatedProgressValueIsNull
protected

◆ _setRealtimeProgressValueIsNull

bool MoreMountains.Tools.MMAdditiveSceneLoadingManager._setRealtimeProgressValueIsNull
protected

◆ _speedIntervals

List<MMSceneLoadingSpeedInterval> MoreMountains.Tools.MMAdditiveSceneLoadingManager._speedIntervals
staticprotected

◆ _unloadLoadingAsyncOperation

AsyncOperation MoreMountains.Tools.MMAdditiveSceneLoadingManager._unloadLoadingAsyncOperation
protected

◆ _unloadOriginAsyncOperation

AsyncOperation MoreMountains.Tools.MMAdditiveSceneLoadingManager._unloadOriginAsyncOperation
protected

◆ DebugMode

bool MoreMountains.Tools.MMAdditiveSceneLoadingManager.DebugMode = false

whether or not to output debug messages to the console

◆ FaderID

int MoreMountains.Tools.MMAdditiveSceneLoadingManager.FaderID = 500

the ID on which to trigger a fade, has to match the ID on the fader in your scene

◆ LoadingAudioListener

AudioListener MoreMountains.Tools.MMAdditiveSceneLoadingManager.LoadingAudioListener

◆ OnAfterEntryFade

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnAfterEntryFade

an event that will be invoked when the delay after the entry fade starts

◆ OnBeforeEntryFade

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnBeforeEntryFade

an event that will be invoked when the delay before the entry fade starts

◆ OnBeforeExitFade

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnBeforeExitFade

an event that will be invoked when the delay before the exit fade starts

◆ OnDestinationSceneActivation

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnDestinationSceneActivation

an event that will be invoked when the destination scene gets activated

◆ OnEntryFade

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnEntryFade

an event that will be invoked when the entry fade starts

◆ OnExitFade

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnExitFade

an event that will be invoked when the exit fade starts

◆ OnInterpolatedLoadProgressComplete

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnInterpolatedLoadProgressComplete

an event that will be invoked when the interpolated load of the destination scene is complete

◆ OnLoadDestinationScene

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnLoadDestinationScene

an event that will be invoked when the destination scene starts loading

◆ OnLoadProgressComplete

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnLoadProgressComplete

an event that will be invoked when the load of the destination scene is complete

◆ OnLoadStarted

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnLoadStarted

an event that will be invoked when the load starts

◆ OnUnloadOriginScene

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnUnloadOriginScene

an event that will be invoked when the origin scene gets unloaded

◆ OnUnloadSceneLoader

UnityEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.OnUnloadSceneLoader

an event that will be invoked when the scene loader gets unloaded

◆ SetInterpolatedProgressValue

ProgressEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.SetInterpolatedProgressValue

an event used to update progress with interpolation

◆ SetRealtimeProgressValue

ProgressEvent MoreMountains.Tools.MMAdditiveSceneLoadingManager.SetRealtimeProgressValue

an event used to update progress


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