Ejemplo n.º 1
0
    void LaunchArrow()
    {
        if (rupeeCounter > 0)
        {
            GameObject arrow = Instantiate(arrowPrefab, rigidbody2d.position + Vector2.up * 0.2f, Quaternion.identity);

            ArrowProjectileController arrowProjectile = arrow.GetComponent <ArrowProjectileController>();
            arrowProjectile.Launch(lookDirection, projectileSpeed);
            rupeeCounter--;
            Debug.Log("Link now has " + rupeeCounter + " rupee(s)");
        }
    }
Ejemplo n.º 2
0
    // --------------------- Attack Methods -------------------------
    void LaunchArrow()
    {
        if (inventory.rupees > 0 && inventory.hasBow && inventory.secActive == Inventory.Secondary.BOW)
        {
            GameObject arrow = Instantiate(arrowPrefab, rigidbody2d.position + Vector2.up * 0.2f, Quaternion.identity);

            ArrowProjectileController arrowProjectile = arrow.GetComponent <ArrowProjectileController>();
            arrowProjectile.Launch(lookDirection, projectileSpeed);
            inventory.rupees--;
            arrowTimer = 1.5f;
            PlaySound(arrowBoom);
        }
    }