public static void LoadAsset(string assetPath) { SceneCache._cache = (AssetDatabase.LoadAllAssetsAtPath(assetPath).Cast <ScriptableObject>().ToArray <ScriptableObject>().Single((ScriptableObject obj) => obj as SceneCache != null) as SceneCache); if (SceneCache.cache == null) { Debug.Log("Dungeon: Cannot find serialized dungeon cache, creating new instance"); SceneCache.CreatAsset(assetPath); } }
public static void LoadDungeon(string assetPath, string scenePath) { SceneCache.CreatAsset(assetPath); SceneCache.cache.scenePath = scenePath; SceneCache.OnCacheChange(); }