public void SpawnNext() { _stairsBlocksCounter++; var obj = _pool.Spawn(); obj.transform.position = _lastStairs == null ? Vector3.zero : new Vector3(0, _lastStairs.transform.position.y + _lastStairs.Height, _lastStairs.transform.position.z + _lastStairs.Length); _activeStairs.Enqueue(obj); _signalBus.Fire(new StairsSpawnedSignal(_stairsBlocksCounter > StairsBlocksWithoutObstacles, obj)); _lastStairs = obj; }
public void Despawn(StairsObject obj) { obj.gameObject.SetActive(false); _pool.Enqueue(obj); }