Пример #1
0
    // 아이템 클리어(슬롯을 비움)한다.
    public void             clearItem(Item.SLOT_TYPE slot, int slot_index)
    {
        switch (slot)
        {
        case Item.SLOT_TYPE.KEY:
        {
            if (this.sprite_key[slot_index] != null)
            {
                this.sprite_key[slot_index].setTexture(this.texture_waku);
                this.sprite_key[slot_index].setVisible(false);
            }
        }
        break;

        case Item.SLOT_TYPE.CANDY:
        {
            if (this.sprite_candy != null)
            {
                this.sprite_candy.setTexture(null);
                this.sprite_candy.setVisible(false);
            }
        }
        break;

        case Item.SLOT_TYPE.MISC:
        {
            if (this.sprite_miscs[slot_index] != null)
            {
                this.sprite_miscs[slot_index].setTexture(null);
                this.sprite_miscs[slot_index].setVisible(false);
            }
        }
        break;
        }
    }
Пример #2
0
    // 슬롯의 아이콘 위치를 가져온다.
    public Vector2          getIconPosition(Item.SLOT_TYPE slot, int slot_index)
    {
        Vector2 position = Vector2.zero;

        switch (slot)
        {
        case Item.SLOT_TYPE.KEY:
        {
            position = this.sprite_key[slot_index].getPosition();
        }
        break;

        case Item.SLOT_TYPE.CANDY:
        {
            position = this.sprite_candy.getPosition();
        }
        break;

        case Item.SLOT_TYPE.MISC:
        {
            position = this.sprite_miscs[slot_index].getPosition();
        }
        break;
        }

        return(position);
    }
Пример #3
0
    // 아이템을 설정한다(아이콘을 표시한다).
    public void             setItem(Item.SLOT_TYPE slot, int slot_index, Item.Favor favor)
    {
        switch (slot)
        {
        //방 열쇠..
        case Item.SLOT_TYPE.KEY:
        {
            this.sprite_key[slot_index].setTexture(this.item_icon_keys[slot_index]);
            this.sprite_key[slot_index].setVisible(this.is_active);
        }
        break;

        // 플로어 이동 도어 열쇠.
        case Item.SLOT_TYPE.FLOOR_KEY:
        {
            this.sprite_floor_key.setTexture(this.item_icon_keys[(int)Item.KEY_COLOR.PURPLE]);
            this.sprite_floor_key.setVisible(this.is_active);
        }
        break;

        case Item.SLOT_TYPE.CANDY:
        {
            this.sprite_candy.setTexture(this.item_icon_candy);
            this.sprite_candy.setVisible(this.is_active);
        }
        break;

        case Item.SLOT_TYPE.MISC:
        {
            this.sprite_miscs[slot_index].setTexture(this.item_icon_ice);
            this.sprite_miscs[slot_index].setVisible(this.is_active);
        }
        break;
        }
    }