private void SpawnSingleShield(Vector3 point) { if (!SpaceDetector.IsFreeSpace(point, _shieldSize / 2f)) { return; } Shield shield = MonoBehaviour.Instantiate(_shield, point, Quaternion.identity, _shieldsParent.transform); shield.transform.LookAt(_owner); }
public void Spawn(Vector3 position, Vector3 direction) { if (!SpaceDetector.IsFreeSpace(position, ElementSize / 2f)) { return; } var spawnPosition = FindSpawnPoint(position, direction); var projectile = MonoBehaviour.Instantiate( _prefab, spawnPosition, Quaternion.identity, _projectilesParent.transform); CoroutineLauncher.Start(DelayedLaunch(projectile, direction)); }