![]() |
Adventure Creator
1.76.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |||
void | OnInitPersistentEngine () | ||
int | NameToIndex (string sceneName) | ||
string | IndexToName (int sceneIndex) | ||
void | SetRelativePosition (Marker marker) | ||
Calculates the player's position relative to the next scene's PlayerStart. More... | |||
virtual Vector3 | GetStartPosition (Vector3 playerStartPosition) | ||
Gets the player's starting position by adding the relative position (set in ActionScene) to the PlayerStart's position. More... | |||
float | GetLoadingProgress () | ||
Gets the progress of an asynchronous scene load as a decimal. More... | |||
bool | IsLoading () | ||
Checks if a scene is being loaded More... | |||
void | PreloadScene (int nextSceneIndex) | ||
Preloads a scene. Preloaded data will be discarded if the next scene opened is not the same as the one preloaded More... | |||
void | PreloadScene (string nextSceneName) | ||
Preloads a scene. Preloaded data will be discarded if the next scene opened is not the same as the one preloaded More... | |||
bool | ChangeScene (int nextSceneIndex, bool saveRoomData, bool forceReload=false, bool doOverlay=false) | ||
Loads a new scene. This method should be used instead of Unity's own scene-switching method, because this allows for AC objects to be saved beforehand More... | |||
bool | ChangeScene (string nextSceneName, bool saveRoomData, bool forceReload=false, bool doOverlay=false) | ||
Loads a new scene. This method should be used instead of Unity's own scene-switching method, because this allows for AC objects to be saved beforehand More... | |||
void | SetTransitionTexture (Texture2D _texture) | ||
Stores a texture used as an overlay during a scene transition. This texture can be retrieved with GetAndResetTransitionTexture(). More... | |||
Texture2D | GetAndResetTransitionTexture () | ||
Gets, and removes from memory, the texture used as an overlay during a scene transition. More... | |||
void | ScheduleForDeletion (GameObject _gameObject) | ||
Deletes a GameObject once the current frame has finished renderering. More... | |||
void | PrepareSceneForExit () | ||
virtual void | PopulateBuildSceneData () | ||
void | ResetCurrentScene () | ||
void | DrawStatus () | ||
void | ActivateLoadedScene () | ||
bool | SubScenesAreOpen () | ||
bool | AddSubScene (int subSceneIndex) | ||
Adds a new scene as a sub-scene, without affecting any other open scenes. More... | |||
bool | AddSubScene (string subSceneName) | ||
Adds a new scene as a sub-scene, without affecting any other open scenes. More... | |||
void | RegisterSubScene (SubScene subScene) | ||
Registers a SubScene component with the SceneChanger. More... | |||
void | UnregisterSubScene (SubScene subScene) | ||
bool | RemoveScene (int sceneIndex) | ||
Removes a scene, without affecting any other open scenes, provided multiple scenes are open. If the active scene is removed, the last-added sub-scene will become the new active scene. More... | |||
bool | RemoveScene (string sceneName) | ||
Removes a scene, without affecting any other open scenes, provided multiple scenes are open. If the active scene is removed, the last-added sub-scene will become the new active scene. More... | |||
PlayerData | SavePlayerData (PlayerData playerData) | ||
Saves data used by this script in a PlayerData class. More... | |||
void | LoadPlayerData (PlayerData playerData, bool loadSubScenes=true) | ||
Loads data used by this script from a PlayerData class. More... | |||
MainData | SaveMainData (MainData mainData) | ||
Saves data used by this script in a MainData class. More... | |||
void | LoadMainData (MainData mainData) | ||
Loads data used by this script from a MainData class. More... | |||
int | GetPreviousSceneIndex (bool forPlayer=false) | ||
Gets the previous scene index.
| |||
string | GetPreviousSceneName (bool forPlayer=false) | ||
Gets the previous scene name.
| |||
SubScene | GetSubScene (int sceneIndex) | ||
Gets a SubScene class associated with a given scene. The scene must be currently opened as a sub-scene More... | |||
SubScene | GetSubScene (string sceneName) | ||
Gets a SubScene class associated with a given scene. The scene must be currently opened as a sub-scene More... | |||
Protected Member Functions | |
void | OnEnable () |
void | OnDisable () |
SceneInfo | GetSceneInfo (int sceneIndex) |
SceneInfo | GetSceneInfo (string sceneName, bool requireInBuildSettings=false) |
void | OnActiveSceneChanged (Scene oldScene, Scene newScene) |
void | OnAfterChangeScene (LoadingGame loadingGame) |
void | OnInitialiseScene () |
IEnumerator | ScheduleForDeletionCoroutine (GameObject _gameObject) |
void | LoadLevel (int nextSceneIndex, bool useLoadingScreen, bool useAsyncLoading, bool forceReload, bool doOverlay) |
void | LoadLevel (string nextSceneName, bool useLoadingScreen, bool useAsyncLoading, bool forceReload, bool doOverlay) |
void | LoadLoadingScreen (int nextSceneIndex, int loadingSceneIndex, bool loadAsynchronously, bool doOverlay) |
void | LoadLoadingScreen (string nextSceneName, string loadingSceneName, bool loadAsynchronously, bool doOverlay) |
void | ExternalCallback () |
IEnumerator | LoadLoadingScreen (SceneInfo loadingSceneInfo, SceneInfo nextSceneInfo, bool loadAsynchronously, bool doOverlay) |
void | LoadLevelAsync (int nextSceneIndex, bool doOverlay) |
void | LoadLevelAsync (string nextSceneName, bool doOverlay) |
IEnumerator | LoadLevelAsync (bool isPreloadScene, SceneInfo nextSceneInfo, bool doOverlay) |
void | PreloadLevelAsync (int nextSceneIndex) |
void | PreloadLevelAsync (string nextSceneName) |
IEnumerator | PreloadLevelAsync (SceneInfo nextSceneInfo) |
void | LoadLevelCo (int nextSceneIndex, bool forceReload, bool doOverlay) |
void | LoadLevelCo (string nextSceneName, bool forceReload, bool doOverlay) |
IEnumerator | LoadLevelCo (SceneInfo nextSceneInfo, bool forceReload, bool doOverlay) |
virtual void | PrepareSceneForExit (bool isInstant, bool saveRoomData, bool doOverlay) |
IEnumerator | CloseScene (int sceneIndex) |
IEnumerator | CloseScene (string sceneName) |
Protected Attributes | |
List< SceneInfo > | buildScenes = new List<SceneInfo> () |
int | previousGlobalSceneIndex = -1 |
string | previousGlobalSceneName |
List< SubScene > | subScenes = new List<SubScene>() |
Vector3 | relativePosition |
AsyncOperation | preloadAsync |
int | preloadSceneIndex = -1 |
string | preloadSceneName |
Texture2D | textureOnTransition = null |
bool | isLoading = false |
float | loadingProgress = 0f |
Vector2 | simulatedCursorPositionOnExit = new Vector2 (-1f, -1f) |
bool | completeSceneActivation |
bool | isAwaitingExternalCallback |
Properties | |
List< SubScene > | SubScenes [get] |
static int | CurrentSceneIndex [get] |
static Scene | CurrentScene [get] |
static string | CurrentSceneName [get] |
int | PreviousSceneIndex [get] |
string | PreviousSceneName [get] |
Handles the changing of the scene, and keeps track of which scene was previously loaded. It should be placed on the PersistentEngine prefab.
void AC.SceneChanger.ActivateLoadedScene | ( | ) |
Activates the loaded scene, if it must be done so manually
bool AC.SceneChanger.AddSubScene | ( | int | subSceneIndex | ) |
Adds a new scene as a sub-scene, without affecting any other open scenes.
subSceneIndex | The index of the new scene to open |
bool AC.SceneChanger.AddSubScene | ( | string | subSceneName | ) |
Adds a new scene as a sub-scene, without affecting any other open scenes.
subSceneName | The name of the new scene to open |
bool AC.SceneChanger.ChangeScene | ( | int | nextSceneIndex, |
bool | saveRoomData, | ||
bool | forceReload = false , |
||
bool | doOverlay = false |
||
) |
Loads a new scene. This method should be used instead of Unity's own scene-switching method, because this allows for AC objects to be saved beforehand
nextSceneIndex | The build index of the scene to load |
saveRoomData | If True, then the states of the current scene's Remember scripts will be recorded in LevelStorage |
forceReload | If True, the scene will be re-loaded if it is already open. |
doOverlay | If True, an overlay texture will be displayed fullscreen during the transition |
bool AC.SceneChanger.ChangeScene | ( | string | nextSceneName, |
bool | saveRoomData, | ||
bool | forceReload = false , |
||
bool | doOverlay = false |
||
) |
Loads a new scene. This method should be used instead of Unity's own scene-switching method, because this allows for AC objects to be saved beforehand
nextSceneName | The name of the scene to load |
saveRoomData | If True, then the states of the current scene's Remember scripts will be recorded in LevelStorage |
forceReload | If True, the scene will be re-loaded if it is already open. |
doOverlay | If True, an overlay texture will be displayed fullscreen during the transition |
void AC.SceneChanger.DrawStatus | ( | ) |
Displays scene-related information for the AC Status window
Texture2D AC.SceneChanger.GetAndResetTransitionTexture | ( | ) |
Gets, and removes from memory, the texture used as an overlay during a scene transition.
float AC.SceneChanger.GetLoadingProgress | ( | ) |
Gets the progress of an asynchronous scene load as a decimal.
|
virtual |
Gets the player's starting position by adding the relative position (set in ActionScene) to the PlayerStart's position.
playerStartPosition | The position of the PlayerStart object |
SubScene AC.SceneChanger.GetSubScene | ( | int | sceneIndex | ) |
SubScene AC.SceneChanger.GetSubScene | ( | string | sceneName | ) |
bool AC.SceneChanger.IsLoading | ( | ) |
Checks if a scene is being loaded
void AC.SceneChanger.LoadMainData | ( | MainData | mainData | ) |
void AC.SceneChanger.LoadPlayerData | ( | PlayerData | playerData, |
bool | loadSubScenes = true |
||
) |
Loads data used by this script from a PlayerData class.
playerData | The PlayerData to load from. |
loadSubScenes | If True, then sub-scenes will be loaded |
|
virtual |
Creates an internal record of all scenes that are in the game. If scenes are added at runtime, this function may need to be overridden to include them.
void AC.SceneChanger.PreloadScene | ( | int | nextSceneIndex | ) |
Preloads a scene. Preloaded data will be discarded if the next scene opened is not the same as the one preloaded
nextSceneIndex | The build index to load |
void AC.SceneChanger.PreloadScene | ( | string | nextSceneName | ) |
Preloads a scene. Preloaded data will be discarded if the next scene opened is not the same as the one preloaded
nextSceneIndex | The build index to load |
void AC.SceneChanger.PrepareSceneForExit | ( | ) |
Saves the current scene objects, kills speech dialog etc. This should if the scene is changed using a custom script, i.e. without using the provided 'Scene: Switch' Action.
void AC.SceneChanger.RegisterSubScene | ( | SubScene | subScene | ) |
Registers a SubScene component with the SceneChanger.
subScene | The SubScene component to register |
bool AC.SceneChanger.RemoveScene | ( | int | sceneIndex | ) |
Removes a scene, without affecting any other open scenes, provided multiple scenes are open. If the active scene is removed, the last-added sub-scene will become the new active scene.
sceneIndex | The index of the new scene to remove |
bool AC.SceneChanger.RemoveScene | ( | string | sceneName | ) |
Removes a scene, without affecting any other open scenes, provided multiple scenes are open. If the active scene is removed, the last-added sub-scene will become the new active scene.
sceneName | The name of the new scene to remove |
void AC.SceneChanger.ResetCurrentScene | ( | ) |
Resets the current scene, clearing all data related to it
PlayerData AC.SceneChanger.SavePlayerData | ( | PlayerData | playerData | ) |
Saves data used by this script in a PlayerData class.
playerData | The PlayerData to save in. |
void AC.SceneChanger.ScheduleForDeletion | ( | GameObject | _gameObject | ) |
Deletes a GameObject once the current frame has finished renderering.
_gameObject | The GameObject to delete |
void AC.SceneChanger.SetRelativePosition | ( | Marker | marker | ) |
Calculates the player's position relative to the next scene's PlayerStart.
marker | The Marker of the GameObject that marks the position that the player should be placed relative to. |
void AC.SceneChanger.SetTransitionTexture | ( | Texture2D | _texture | ) |
Stores a texture used as an overlay during a scene transition. This texture can be retrieved with GetAndResetTransitionTexture().
_texture | The Texture2D to store |
|
staticget |
The current scene. If multiple scenes are open, this will be the main scene.
|
staticget |
The current scene index. If multiple scenes are open, this will be the main scene.
|
staticget |
The current scene name. If multiple scenes are open, this will be the main scene.
|
get |
The index of the previous scene loaded. This is not necessarily the current Player's previous scene - for that, use GetPreviousSceneIndex (true)
|
get |
The name of the previous scene loaded. This is not necessarily the current Player's previous scene - for that, use GetPreviousSceneName (true)
|
get |
All open SubScenes