Example #1
0
    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();
        }
    }
Example #2
0
 private T GetOrCreateComponent <T>(Entity entity, ComponentPool <T> pool) where T : Component
 {
     return(HasComponent <T>(entity) ? GetComponentObject <T>(entity) : pool.GetComponent());
 }