public virtual void Shoot(FMNObject parent, Vector2 direction) { isShot = true; this.direction = direction.normalized; this.angle = Vector2.Angle(Vector2.right, direction); this.transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + angle); this.transform.position = (Vector2)parent.transform.position + (this.direction * shootingOffsetInDirection + shootingOffset); if (!rb) { CreateRigidBody(); } if (!isKinematic) { this.rb.velocity = direction * speed; } }
public static void PlaySoundAttached(string path, FMNObject obj) { FMODUnity.RuntimeManager.PlayOneShotAttached(path, obj.gameObject); }
public static void PlaySound(string path, FMNObject obj) { FMODUnity.RuntimeManager.PlayOneShot(path, obj.transform.position); }