protected void Shoot()
    {
        Shell _shell = shellPool.GetComponent();

        if (_shell)
        {
            Vector3 _direction = Quaternion.AngleAxis(shotUpAngle, -transform.right) * transform.forward;
            _shell.Shoot(shotSocket.transform.position, _direction, gameObject);
            shotSound?.Play();
        }
    }
Exemple #2
0
 private T GetOrCreateComponent <T>(Entity entity, ComponentPool <T> pool) where T : Component
 {
     return(HasComponent <T>(entity) ? GetComponentObject <T>(entity) : pool.GetComponent());
 }