예제 #1
0
 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());
     }
 }
예제 #2
0
    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;
    }
예제 #3
0
 void Start()
 {
     _shootingTemplate = _gameSettings.WarriorShooting;
     SetupShootingTemplates();
 }