public void Init() { _mortarSpawns = GameObject.FindObjectsOfType <MortarSpawn>(); _audioPool = GameObject.FindObjectOfType <AudioSourcePoolManager>(); EventManager.StartListening("Mortar", BarrageRequest); EventManager.StartListening("Intro1", IntroBarrageRequest); EventManager.StartListening("Intro2", IntroBarrageRequest); EventManager.StartListening("Intro3", IntroBarrageRequestOnTreasure); }
private void Start() { _shipCondition = GetComponentInParent <ShipCondition>(); _particleSystem = GetComponentsInChildren <ParticleSystem>(); _spawnPos = GetComponentInChildren <ItemSpawn>(); _audioPool = FindObjectOfType <AudioSourcePoolManager>(); if (_spawnPos == null) { Debug.LogError("Missing spawn position script on children objects. You need to create a child game object and assign ItemSpawn script to it"); } }
public void Update() { profiler.Begin(); FabricTimer.Update(); EventManager.Instance.UpdateInternal(); for (int i = 0; i < _components.Count; i++) { _updateContext.Reset(); Component component = _components[i]; if (component.IsComponentActive()) { component.UpdateInternal(ref _updateContext); } } UpdateMusicTimeSettings(); UpdateGroupComponentProxies(ref _updateContext); if (AudioSourcePoolManager != null) { AudioSourcePoolManager.Update(); } profiler.End(); }
void Awake() { GraphicsSettings.useScriptableRenderPipelineBatching = true; #if !UNITY_EDITOR Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; #endif _levelEventManager = gameObject.AddComponent <LevelEventManager>(); _audioSourcePoolManager = gameObject.AddComponent <AudioSourcePoolManager>(); // Spawn players _entityManager = new EntityManager(playerPrefab); for (int i = 1; i <= _numberOfPlayers; i++) // Player index starts from 1 { _entityManager.CreatePlayer(i); } // Setup camera _cameraHandler = FindObjectOfType <CameraHandler>(); _treasureManager = new TreasureManager(); _roundTimer = new RoundTimer(); _navMeshManager = gameObject.AddComponent <NavMeshManager>(); _shipManager = gameObject.AddComponent <ShipManager>(); _hazardManager = GetComponent <HazardManager>(); _mortarManager = new MortarManager(); _krakenManager = new KrakenManager(); _cameraHandler.Init(_entityManager.GetAllPlayers()); _treasureManager.Init(goldCounterUI); _roundTimer.Init(roundTimeUI); _navMeshManager.Init(_shipManager.GetShip(ShipType.Player)); _shipManager.Init(); _hazardManager.Init(roundTimeUI, _shipManager.GetShip(ShipType.Player)); _mortarManager.Init(); _krakenManager.Init(); }
private void Start() { _audioPool = FindObjectOfType <AudioSourcePoolManager>(); }