Exemplo n.º 1
0
    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;
        }
    }
Exemplo n.º 2
0
 public static void PlaySoundAttached(string path, FMNObject obj)
 {
     FMODUnity.RuntimeManager.PlayOneShotAttached(path, obj.gameObject);
 }
Exemplo n.º 3
0
 public static void PlaySound(string path, FMNObject obj)
 {
     FMODUnity.RuntimeManager.PlayOneShot(path, obj.transform.position);
 }