Beispiel #1
0
    public void ShowItemInven(List <Player> playerlist, ItemData[] itemdata)
    {
        mPlayerList      = new List <Player>();
        mApplyInvenList  = new List <ApplyInvenElement>();
        mBattleInvenList = new List <BattleInvenElement>();

        mItemData   = itemdata;
        mPlayerList = playerlist;

        for (int i = 0; i < SaveLoadData.Instance.SaveData.ItemNum.Length; i++)
        {
            if (SaveLoadData.Instance.SaveData.ItemNum[i] > 0)
            {
                BattleInvenElement inven = mItemElePool.GetFromPool(0);
                inven.Init(
                    null,
                    mItemData[i].ID,
                    mItemData[i].Name,
                    SaveLoadData.Instance.SaveData.ItemNum[i],
                    mItemData[i].Info,
                    mItemData[i].Value,
                    ArrangePlayer);

                mBattleInvenList.Add(inven);
            }
        }

        for (int i = 0; i < mPlayerList.Count; i++)
        {
            ApplyInvenElement apply = Instantiate(mApplyInven, mApplyInvenPos);
            apply.Init(
                mPlayerList[i].ID,
                mPlayerList[i].Name,
                mPlayerList[i].HPcurrent,
                mPlayerList[i].HPmax,
                mPlayerList[i].ATK,
                mPlayerList[i].DEF,
                mPlayerList[i].HEAL,
                ApplyItem);

            mApplyInvenList.Add(apply);

            mApplyInvenList[i].gameObject.SetActive(false);
        }
    }
Beispiel #2
0
    public void ShowItemInven(List <Player> playerlist, EquipData[] equipdata)
    {
        mPlayerList     = new List <Player>();
        mEquiplist      = new List <BattleInvenElement>();
        mApplyInvenList = new List <ApplyInvenElement>();

        mEquipDataArr = equipdata;
        mPlayerList   = playerlist;

        for (int i = 0; i < SaveLoadData.Instance.SaveData.EquipNum.Length; i++)
        {
            if (SaveLoadData.Instance.SaveData.EquipNum[i] > 0)
            {
                BattleInvenElement inven = Instantiate(mInvenPrefab, mInvenPos);
                inven.Init(
                    null,
                    mEquipDataArr[i].ID,
                    mEquipDataArr[i].Name,
                    SaveLoadData.Instance.SaveData.EquipNum[i],
                    mEquipDataArr[i].Info,
                    mEquipDataArr[i].Value,
                    ArrangePlayer);

                mEquiplist.Add(inven);
            }
        }

        for (int i = 0; i < mPlayerList.Count; i++)
        {
            ApplyInvenElement apply = Instantiate(mApplyInven, mApplyInvenPos);
            apply.Init(
                mPlayerList[i].ID,
                mPlayerList[i].Name,
                mPlayerList[i].HPcurrent,
                mPlayerList[i].HPmax,
                mPlayerList[i].ATK,
                mPlayerList[i].DEF,
                mPlayerList[i].HEAL,
                ApplyItem);

            mApplyInvenList.Add(apply);
        }
    }