void RemoveRooms() { var entityManager = masterSystem.TryGetManager <EntitySceneManager>(SceneManagerType.Entity); entityManager.Reset(); for (int i = roomsParent.childCount - 1; i >= 0; i--) { Destroy(roomsParent.GetChild(i).gameObject); } ResetState(); }
public override void Init(MasterSystem masterSystem, SceneManagerData data) { base.Init(masterSystem, data); projectileManager = masterSystem.TryGetManager <ProjectileManager>(SceneManagerType.Projectile); if (projectileManager == null) { Debug.LogError("[ItemSceneSystem]: tried to get projectileManager but it wasn't initialized"); return; } CollectSceneItems(); foreach (var item in items) { item.Initialize(data.player, data.playerController, projectileManager); } ChangeInitializationState(ManagerInitializationState.COMPLETED); }