top of page

ProMonoBehaviour

A class that inherits from MonoBehaviour and implements the IHostable, ILateIntialized and ISaveable interfaces. This class also subscribes to initialization and late initialization by default, but has to be added to save.

Fields

addToSave

Determines whether or not this class should be added to the save.

callCompleteScenePrep

Determines whether or not this class should call the CompleteScenePrep() function.

canHost

Determines the conditions when a load should be attempted from the drive / server.

includeInInitialization

Determines whether or not this class should be added to initialization.

includeInLateInitialization

Determines whether or not this class should be added to late initialization.

initializationWeight

Determine the order in which a particular object should be called during initialization. Lower numbers occur first.

lateInitializeWeight

Determines the order in which a particular object should be called during late initialization. Lower numbers occur first. It is best practice to have LateInitialize weight set to a number greater than 0.

loadGameWeight

Determines the order in which a particular object is loaded during loading. Lower numbers occur first.

saveGameWeight

Determines the order in which a particular object is saved during saving. Lower numbers occur first.

Properties

AddToSave

Determines whether or not this class should be added to the save.

CallCompleteScenePrep

Determines whether or not this class should call the CompleteScenePrep() function.

CanHost

Determines whether or not this class can host initialization, late initialization, save/load and other ProSaver operations.

IncludeInInitialization

Determines whether or not this class should be added to initialization.

IncludeInLateInitialization

Determines whether or not this class should be added to late initialization.

InitializationWeight

Determine the order in which a particular object should be called during initialization. Lower numbers occur first.

 

LateInitializationWeight

Determines the order in which a particular object should be called during late initialization. Lower numbers occur first. It is best practice to have LateInitializeWeight set to a number greater than 0.

LoadGameWeight

Determines the order in which a particular object is loaded during loading. Lower numbers occur first.

SaveGameWeight

Determines the order in which a particular object is saved during saving. Lower numbers occur first.

Methods

Awake

Adds this to initialization if CallInitialize == true, to LateInitialize is CallLateInitialize == true, to Save and Load if AddToSave == true, and to CompleteScenePrep if CallCompleteScenePrep == true. Also, declares Initialization if not already declared.

CompleteScenePrep

This function is called when all scene initializations and late initializations are completed. Override it to add functionality. Note that all classes that implement this call it on the same frame, so be wary of throttling.

Initialize

The function that is called during initialization. Override it to add functionality.

LateInitialize

The function that is called during late initialization. Use this to set up your games state after data is loaded from the drive or server.

Override it to add functionality.

OnDestroy

Removes this from initialization and late initialization and save if still included.

bottom of page