コード例 #1
0
    public void UseItem(Item itemData)
    {
        if (!itemWindow.CanUse(itemData))
        {
            NotExcute();
            return;
        }

        itemWindow.Close();

        //List<PlayerCharacter> party = PlayerParty.Instance.partyMember;
        List <CharacterData> party = Party.GetMember();

        MenuWindow.instance.menuGuide.Show(itemData.itemName + "使用対象を選んでください");

        //複数対象の処理
        if (itemData.targetRange == TargetRange.全体)
        {
            characterWindow.SelectAll();
            characterWindow.ClearLisner();
            characterWindow.AddLisner((int index) =>
            {
                AllItemExecut(itemData);
                MenuWindow.instance.menuGuide.Hide();
            });
        }
        else
        {
            characterWindow.Select(0);
            characterWindow.ClearLisner();
            characterWindow.AddLisner((int index) =>
            {
                CharacterData playerCharacter = party[index];
                ItemExecut(itemData, playerCharacter);
                MenuWindow.instance.menuGuide.Hide();
            });
        }
    }