void CreateAndPush(ShootingTemplate shootingTemplate) { if (!_canShootAgain) { //spawn projectile on each end of the shooting template for (int i = 0; i < shootingTemplate.ProjectileSpawnPoint.Length; i++) { Projectile projectile = _projectileFactory.CreateProjectile(shootingTemplate.ProjectileSpawnPoint[i].transform); } _canShootAgain = true; StartCoroutine(waitToShootAgain()); } }
void SetupShootingTemplates() { //create the shooting template STTop = Object.Instantiate(_shootingTemplate, top.transform); //rotate the shooting template to allign it in the right direction STTop.transform.rotation = top.transform.rotation; STDown = Object.Instantiate(_shootingTemplate, down.transform); STDown.transform.rotation = down.transform.rotation; STLeft = Object.Instantiate(_shootingTemplate, left.transform); STLeft.transform.rotation = left.transform.rotation; STRight = Object.Instantiate(_shootingTemplate, right.transform); STRight.transform.rotation = right.transform.rotation; }
void Start() { _shootingTemplate = _gameSettings.WarriorShooting; SetupShootingTemplates(); }