Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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));
        }