Ejemplo n.º 1
0
        public void Fire(Vector3 velocity, AudioPlayOnce source, ForceMode ForceType = ForceMode.Impulse)
        {
            var a = Instantiate(projectile.Value);

            a.transform.position = transform.transform.position;
            var rb = a.GetComponent <Rigidbody>();

            rb.AddForce(velocity, ForceType);
            source?.Play(sfx);
            if (vfx != null)
            {
                vfx?.Play();
            }
        }