예제 #1
0
    void Launch()
    {
        GameObject proyectilObject = Instantiate(proyectilPrefab, rigidbody2d.position + Vector2.up * 0.5f, Quaternion.identity);

        Proyectil proyectil = proyectilObject.GetComponent <Proyectil>();

        proyectil.Launch(lookDirection, 300);

        animator.SetTrigger("Launch");
        audioSource.PlayOneShot(shootingSound);
    }