Ejemplo n.º 1
0
    public bool HoldPill(Pill.Effect effect)
    {
        if (PickupCooldown == 0)
        {
            PickupCooldown = 10;

            if (isHoldingPill())
            {
                Vector3 temppos = gameObject.transform.position;
                temppos.y += 2;

                Pill newPill = (Instantiate(PillPrefab, temppos, Quaternion.identity) as GameObject).GetComponent <Pill>();
                newPill.PillEffect = PillEffect;
            }

            PillEffect = effect;

            levelMenu.SetHUDPill(effect);

            return(true);
        }
        else
        {
            return(false);
        }
    }