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