public void Initialize() { Vector3 size = _boundProvider.GetWorldPosition(new Vector3(1f, 1f)) - _boundProvider.GetWorldPosition(new Vector3(-1f, -1f)); size.z = 1f; _bounds = new Bounds(Vector3.zero, size * 0.5f + new Vector3(GameRules.BoundOffset, GameRules.BoundOffset)); }
private void SetUpNextOpponentSpawn() { _opponentSpawnDisposable?.Dispose(); _opponentSpawnDisposable = _timingManager.Delay( TimeSpan.FromSeconds(Random.Range(GameRules.OpponentSpawnMinDuration, GameRules.OpponentSpawnMaxDuration)), () => { var spawn = GameRules.OpponentSpawns.GetRandom(); var opponent = new Opponent(spawn.FlightDirection); _opponentBehaviour.Bind(opponent, _boundProvider.GetWorldPosition(spawn.NormalizedLocation)); opponent.Death += OnOpponentDeath; }); }