Exemplo n.º 1
0
    private void OnNew(GameObject go)
    {
        config_map_item config_map_item = new config_map_item();

        config_map_item.id     = resourceMgr.config_map.data[resourceMgr.config_map.GetDataCount() - 1].id + 1;
        config_map_item.icon   = config_map_item.id;
        config_map_item.name   = "" + (config_map_item.id % 10000);
        config_map_item.desc   = "";
        config_map_item.pre_id = (config_map_item.id - 1);
        config_map_item.task   = "10101|20,10102|20,10103|20,10104|20,10105|20";
        config_map_item.step   = 32;

        config_map_item.build        = 10000;
        config_map_item.fill         = 10000;
        config_map_item.judge        = "1800,3500,5200";
        config_map_item.forbid_skill = "";

        resourceMgr.config_map.data.Add(config_map_item);

        BattleInfo battleInfo = new BattleInfo();

        battleInfo.mapId = config_map_item.id;
        battleInfo.FillNew(GridModel.Instance.set_start_x, GridModel.Instance.set_start_y, GridModel.Instance.set_end_x, GridModel.Instance.set_end_y, GridModel.Instance.set_battle_width, GridModel.Instance.set_battle_height);
        BattleModel.Instance.battles.Add(battleInfo);

        ToggleList toggleList = togglePart.UpDateList(FightLayerType.map);
        GameObject toggleItem = toggleList.list.GetItemByName("item_" + config_map_item.id);
        Toggle     toggle     = toggleItem.GetComponent <Toggle> ();

        toggle.isOn = true;
    }
Exemplo n.º 2
0
    private IEnumerator LoadDats()
    {
        for (int i = 0; i < config_map.data.Count; i++)
        {
            config_map_item item       = config_map.data[i];
            BattleInfo      battleInfo = new BattleInfo();
            battleInfo.mapId = item.id;
            if (FileUtil.Instance().HasFile("dat/map/" + item.id, ".bytes"))
            {
                WWW www = new WWW(sourceArtPath + "dat/map/" + item.id + ".bytes");
                yield return(www);

                battleInfo.FillByte(www.bytes);
            }
            else
            {
                battleInfo.FillNew(GridModel.Instance.set_start_x, GridModel.Instance.set_start_y, GridModel.Instance.set_end_x, GridModel.Instance.set_end_y, GridModel.Instance.set_battle_width, GridModel.Instance.set_battle_height);
            }
            BattleModel.Instance.battles.Add(battleInfo);
        }
    }