From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Misc/SaveAndLoadHelper.h | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Runtime/Misc/SaveAndLoadHelper.h (limited to 'Runtime/Misc/SaveAndLoadHelper.h') diff --git a/Runtime/Misc/SaveAndLoadHelper.h b/Runtime/Misc/SaveAndLoadHelper.h new file mode 100644 index 0000000..f9bd799 --- /dev/null +++ b/Runtime/Misc/SaveAndLoadHelper.h @@ -0,0 +1,58 @@ +#ifndef SAVEANDLOADHELPER_H +#define SAVEANDLOADHELPER_H + +#include +#include +#include +#include +#include "Runtime/BaseClasses/BaseObject.h" +#include "Runtime/Utilities/GUID.h" +#include "Runtime/Misc/GarbageCollectSharedAssets.h" + +class AssetBundle; +class AwakeFromLoadQueue; + +typedef dynamic_array InstanceIDArray; + +void DestroyWorld (bool destroySceneAssets); + +bool InitializeEngineNoGraphics (); +bool InitializeEngineGraphics (bool batch = false); +void CleanupEngine (); +void CleanupAllObjects (bool reloadable); + +void CreateWorldEditor (); +void CleanupAfterLoad (); + +/// Loads a new world from a pathname, playmode or editmode +/// Returns true if any datatemplates were merged while loading. +bool LoadSceneEditor (const std::string& pathName, std::map* hintFileIDToHeapID, int mode); + +void PostLoadLevelAdditive (const std::string& pathName, AwakeFromLoadQueue& awakeQueue); +void PostEditorLoadLevelAdditive (const std::string& pathName, AwakeFromLoadQueue& awakeQueue); +void CompletePreloadManagerLoadLevel (const std::string& path, AwakeFromLoadQueue& awakeQueue); +void CompletePreloadMainData (AwakeFromLoadQueue& awakeQueue); +void CompletePreloadManagerLoadLevelEditor (const std::string& path, AwakeFromLoadQueue& awakeQueue, int preloadOperationMode); + +void LoadLevelAdditiveEditor (const std::string& level); + +void CollectSceneGameObjects (InstanceIDArray& instanceIDs); + +void CheckAllGOConsistency (); + +void PostprocessScene (); + +void UnloadAssetBundle (AssetBundle& file, bool unloadAllLoadedObjects); + +void VerifyNothingIsPersistentInLoadedScene (const std::string& pathName); + +/// Make there are any game objects and/or level managers still present, print an error message. +/// +/// @param includeAllEditorExtensions If true, not only check for GameObjects but also for +/// any object derived from EditorExtension. +void ValidateNoSceneObjectsAreLoaded (bool includeAllEditorExtensions = false); + +extern const char* kMainData; + + +#endif -- cgit v1.1-26-g67d0