예제 #1
0
    public void PickUp(Item item)
    {
        Color color = item.GetComponent <SpriteRenderer> ().color;

        if (item.article == "hat")
        {
            Drop(hat);
            hat             = item;
            hatBorder.color = color;
        }
        else if (item.article == "staff")
        {
            Drop(staff);
            staff             = item;
            staffBorder.color = color;
        }
        else if (item.article == "boots")
        {
            Drop(boots);
            boots             = item;
            bootsBorder.color = color;
        }
        else
        {
            Debug.Log("Can't pick up " + item + ". Invalid article.");
            return;
        }

        spellController.UpdateAvailableSpells(new Item[] { hat, staff, boots });

        item.Disable();
    }