示例#1
0
    private void ReloadMonsterSelected()
    {
        InventoryCellView2 inventory = new InventoryCellView2();

        for (int i = 0; i < _data.Count; i++)
        {
            for (int j = 0; j < listMonsterSelected.Count; j++)
            {
                if (_data[i].monsterName == listMonsterSelected[j])
                {
                    inventory.ReturnStack.Push(_data[i].id);
//					stack.Push(i);
                    _data[i].Selected = true;
                    inventory.ReturnHashTable.Add(_data[i].id, _data[i].monsterName);
//					hashtableMonster.Add(i,_data[i].monsterName);
                }
                if (_data[i].monsterName2 == listMonsterSelected[j])
                {
                    inventory.ReturnStack.Push(_data[i].id2);
                    //					stack.Push(i);
                    _data[i].Selected2 = true;
                    inventory.ReturnHashTable.Add(_data[i].id2, _data[i].monsterName2);
                    //					hashtableMonster.Add(i,_data[i].monsterName);
                }
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        //string sql = "SELECT " +
        //    "MQ.ID, " +
        //    "MQ.Image, " +
        //    "MQ.PosX, " +
        //    "MQ.PosY, " +
        //    "MQ.Atk, " +
        //    "MQ.Def, " +
        //    "MQ.Hp, " +
        //    "E.Apply, " +
        //    "E.Value, " +
        //    "E.Turn, " +
        //    "ET.Type " +
        //    "FROM MonsterEquip MQ " +
        //    "JOIN Effects E " +
        //    "ON MQ.EffectID = E.EffectID " +
        //    "JOIN EffectType ET " +
        //    "ON E.EffectTypeID = ET.EffectTypeID ";

        //mqList = dbManager.Query<MonsterEquipRaw>(sql);
        //Debug.Log(mqList.Count);

        //jsonMonsterFile = Resources.Load("monstersequip") as TextAsset;
        //jsonMonsters = JsonMapper.ToObject(jsonMonsterFile.text);
        inventoryGO = GameObject.FindGameObjectWithTag("Inventory");
//		inventory = new InventoryCellView2 ();
        inventory = inventoryGO.AddComponent <InventoryCellView2>();
//		inventory = inventoryGO.AddComponent(
        hashtable = inventory.ReturnHashTable;

        monsterInventoryScript = monsterSelectPopup.GetComponent <MonsterInventory2> ();
        onCD = true;
        //shuffeld = false;
    }
示例#3
0
    public EnhancedScrollerCellView GetCellView(EnhancedScroller scroller, int dataIndex, int cellIndex)
    {
        InventoryCellView2 cellView = scroller.GetCellView(vCellViewPrefab) as InventoryCellView2;

        cellView.name     = "Vertical " + _data [dataIndex].monsterName;
        cellView.selected = CellViewSelected;
        cellView.SetData(dataIndex, _data[dataIndex], true);
        return(cellView);
    }