예제 #1
0
        private void Fire()
        {
            ShellBase newShell = shellPool.GetInctance();

            newShell.transform.position = shellHolder.position;
            newShell.transform.forward  = shellHolder.transform.forward;
            newShell.gameObject.SetActive(true);
            newShell.Fire();
        }
예제 #2
0
 private void PreSpawnShells(int count)
 {
     for (int i = 0; i < count; i++)
     {
         ShellBase newShell = Instantiate(shell, shellHolder.transform.position, Quaternion.identity);
         newShell.InjectPool(shellPool);
         newShell.gameObject.SetActive(false);
         newShell.transform.SetParent(shellHolder);
         newShell.SetDamageAmount(weaponSettings.Damage);
         shellPool.SetInstance(newShell);
     }
 }