void Update() { if (!Application.isPlaying && gameObject.scene != null && prefabSet != null) { if (testWorld != lastTestWorld || prefabSet != lastPrefabSet) { lastTestWorld = testWorld; lastPrefabSet = prefabSet; var prefab = WorldManager.I.GetPrefab(prefabSet, testWorld); UpdatePrefab(prefab); } } }
public GameObject GetPrefab(WorldPrefabSet prefabSet, WorldID world) { if (world == WorldID.Default) { if (prefabSet.defaultPrefab != null) { return(prefabSet.defaultPrefab); } return(prefabSet.worldPrefabs[0]); } else { return(prefabSet.worldPrefabs[(int)world]); } }
/// <summary> /// Get prefab for current world /// </summary> public GameObject GetPrefab(WorldPrefabSet prefabSet) { return(GetPrefab(prefabSet, CurrentWorld)); }