Esempio n. 1
0
    public void ShowList()
    {
        selectDepth = 0;

        list.ClearList();

        int i;

        for (i = 0; i < CellModel.Instance.allCells.Count; i++)
        {
            List <CellInfo> cellXs = CellModel.Instance.allCells[i];
            for (int j = 0; j < cellXs.Count; j++)
            {
                CellInfo cellInfo    = cellXs[j];
                bool     isCoverOpen = CoverModel.Instance.IsOpen(cellInfo.posX, cellInfo.posY);
                if (cellInfo.isBlank == false && cellInfo.isMonsterHold == false && cellInfo.config.cell_type == (int)CellType.five && isCoverOpen)
                {
                    CreateSelectItem(j, i, true);
                }
                else
                {
                    CreateSelectItem(j, i, false);
                }
            }
        }
    }
Esempio n. 2
0
    public void InitProps()
    {
        list.ClearList();

        List <PropInfo> allProps = PropModel.Instance.allProps;

        bool hasOpen = false;
        int  i;

        for (i = 0; i < allProps.Count; i++)
        {
            PropInfo propInfo = allProps[i];
            if (propInfo.isForbid == false)
            {
                hasOpen = true;
            }
        }

        if (hasOpen)
        {
            for (i = 0; i < allProps.Count; i++)
            {
                PropInfo propInfo = allProps[i];
                CreatePropItem(propInfo, i, allProps.Count);
            }
        }
    }
Esempio n. 3
0
    public void UpdateMap()
    {
        list.ClearList();

        CreatItem("start_x", ref BattleModel.Instance.crtBattle.start_x);
        CreatItem("end_x", ref BattleModel.Instance.crtBattle.end_x);
        CreatItem("battle_width", ref BattleModel.Instance.crtBattle.battle_width);

        CreatItem("start_y", ref BattleModel.Instance.crtBattle.start_y);
        CreatItem("end_y", ref BattleModel.Instance.crtBattle.end_y);
        CreatItem("battle_height", ref BattleModel.Instance.crtBattle.battle_height);

        CreatItem("id", ref BattleModel.Instance.crtConfig.id);
        CreatItem("icon", ref BattleModel.Instance.crtConfig.icon);
        CreatItem("name", ref BattleModel.Instance.crtConfig.name);
        CreatItem("desc", ref BattleModel.Instance.crtConfig.desc);

        CreatItem("pre_id", ref BattleModel.Instance.crtConfig.pre_id);
        CreatItem("task", ref BattleModel.Instance.crtConfig.task);
        CreatItem("step", ref BattleModel.Instance.crtConfig.step);
        CreatItem("build", ref BattleModel.Instance.crtConfig.build);
        CreatItem("fill", ref BattleModel.Instance.crtConfig.fill);
        CreatItem("judge", ref BattleModel.Instance.crtConfig.judge);
        CreatItem("forbid_skill", ref BattleModel.Instance.crtConfig.forbid_skill);
        CreatItem("forbid_prop", ref BattleModel.Instance.crtConfig.forbid_prop);
    }
Esempio n. 4
0
    private void InitHoleList(bool playEffect)
    {
        listHole.ClearList();

        int           i;
        SkillHoleItem findNextOpen = null;

        for (i = 1; i <= SkillTempletModel.MAX_LEVEL; i++)
        {
            GameObject item = listHole.NewItem();
            item.name = skillTempletInfo.config.cellId + "_" + i;

            SkillHoleItem itemCtr = item.GetComponent <SkillHoleItem>();
            itemCtr.skillGroupInfo = skillGroupInfo;
            itemCtr.islock         = false;
            itemCtr.ShowName("");
            itemCtr.waitAnim.enabled = false;
            if (i > skillTempletInfo.lv)
            {
                if (findNextOpen == null)
                {
                    findNextOpen             = itemCtr;
                    itemCtr.waitAnim.enabled = true;
                }
                else
                {
                    itemCtr.islock = true;
                }
            }
            else
            {
                if (i > 1)
                {
                    itemCtr.bombImage.color = ColorUtil.GetColor(ColorUtil.MAP_PASS, 0.9f);
                }
            }

            Vector2 pos = SkillTempletModel.Instance.GetHolePos(i, false, skillTempletInfo.config.dir);
            PosUtil.SetCellPos(item.transform, (int)pos.x, (int)pos.y + 1, 1.1f);

            if (i == 1)
            {
                itemCtr.icon = skillTempletInfo.config.cellId;
                itemCtr.bombImage.gameObject.SetActive(false);
            }
            else if (i == skillTempletInfo.lv && playEffect)
            {
                itemCtr.iconImage.gameObject.SetActive(false);
                GameObject effectPrefab = ResModel.Instance.GetPrefab("effect/" + "effect_fireworks");
                GameObject itemEffect   = GameObject.Instantiate(effectPrefab);
                itemEffect.transform.SetParent(itemCtr.transform, false);
                itemEffect.transform.SetParent(transform, true);
            }
        }
    }
Esempio n. 5
0
    public void InitTasks()
    {
        list.ClearList();

        List <TIVInfo> taskList = BattleModel.Instance.crtConfig.GetTaskList();

        int taskLen = taskList.Count;

        for (int i = 0; i < taskLen; i++)
        {
            CreateTaskItem(i, taskList[i]);
        }
    }
Esempio n. 6
0
    private void InitChapterList()
    {
        chapterList.ClearList();

        List <config_chapter_item> datas = ResModel.Instance.config_chapter.data;
        int totalChapterCount            = datas.Count;
        int i;

        for (i = 0; i < totalChapterCount; i++)
        {
            config_chapter_item config_chapter = datas[i];
            CreateChapterItem(config_chapter, i + 1);
        }
    }
Esempio n. 7
0
    private void InitChapterList()
    {
        chapterList.ClearList();

        List <config_chapter_item> datas = GameMgr.resourceMgr.config_chapter.data;
        int totalChapterCount            = datas.Count;
        int i;

        for (i = 0; i < totalChapterCount; i++)
        {
            config_chapter_item config_chapter = datas[i];
            CreateChapterItem(config_chapter, i + 1);
        }
    }
Esempio n. 8
0
    public void ShowList(int startX, int endX, int startY, int endY, float scale = 1)
    {
        list.ClearList();

        int i;

        for (i = startY; i <= endY; i++)
        {
            for (int j = startX; j <= endX; j++)
            {
                CreateHiveItem(j, i, scale);
            }
        }
    }
Esempio n. 9
0
    public void InitTasks()
    {
        list.ClearList();

        List <TIVInfo> taskList = BattleModel.Instance.crtConfig.GetTaskList();

        int taskLen = taskList.Count;

        for (int i = 0; i < taskLen; i++)
        {
            CreateTaskItem(i, taskList[i]);
        }
        FontUtil.SetAllFont(transform, FontUtil.FONT_DEFAULT);
    }
Esempio n. 10
0
    public void ShowList(int halfY, int halfX)
    {
        halfWidth  = halfX;
        halfHeight = halfY;
        list.ClearList();

        int i;

        for (i = halfY; i >= -halfY; i--)
        {
            for (int j = -halfX; j <= halfX; j++)
            {
                CreateHiveItem(j, i);
            }
        }
    }
Esempio n. 11
0
    private void InitList()
    {
        smallList.ClearList();
        groupList.ClearList();

        for (int i = 0; i < SkillTempletModel.Instance.skillGroups.Count; i++)
        {
            SkillGroupInfo skillTempletGroupInfo = SkillTempletModel.Instance.skillGroups[i];
            skillTempletGroupInfo.index = i;
            CreateSmallItem(skillTempletGroupInfo, i);
            CreateGroupItem(skillTempletGroupInfo);
        }

        selectGroupIndex = SkillTempletModel.Instance.selectGroupIndex;

        SwitchGroup();
    }
Esempio n. 12
0
    public void Init(SkillGroupInfo info)
    {
        skillTempletGroupInfo = info;

        gameObject.SetActive(false);

        list.ClearList();
        int tindex = 0;

        for (int i = 0; i < info.skillTemplets.Count; i++)
        {
            SkillTempletInfo skillTempletInfo = info.skillTemplets[i];
            if (skillTempletInfo.config.type == 1)
            {
                CreatTempletItem(info, skillTempletInfo, tindex);
            }
        }
    }
Esempio n. 13
0
    public void InitSeeds()
    {
        list.ClearList();
        bool hasOpen = false;
        int  i;

        for (i = 0; i < SkillModel.Instance.seeds.Count; i++)
        {
            SkillSeedInfo seed = SkillModel.Instance.seeds[i];
            if (seed.fobid == false)
            {
                hasOpen = true;
            }
        }

        if (hasOpen)
        {
            for (i = 0; i < SkillModel.Instance.seeds.Count; i++)
            {
                SkillSeedInfo seed = SkillModel.Instance.seeds[i];
                CreateItem(seed);
            }
        }
    }
Esempio n. 14
0
    private void InitMapList()
    {
        mapList.ClearList();
        List <int> mapIds = MapModel.Instance.selectChapter.GetMapIds();

        AudioModel.Instance.PlayeSound("click");
        if (mapIds.Count < 1)
        {
            comingTrans.gameObject.SetActive(true);
        }
        else
        {
            comingTrans.gameObject.SetActive(false);

            //string[] mapIndexs = MapModel.Instance.selectChapter.GetMapIndexs();
            int i;
            for (i = 0; i < mapIds.Count; i++)
            {
                config_map_item config_map = (config_map_item)ResModel.Instance.config_map.GetItem(mapIds[i]);

                CreateMapItem(config_map, i);
            }
        }
    }
Esempio n. 15
0
 void OnDisable()
 {
     list.ClearList();
 }
Esempio n. 16
0
    public void InitList(FightLayerType type)
    {
        toggleItemListType = type;

        list.ClearList();

        List <config_item_base> datas = new List <config_item_base>();
        int i;

        switch (toggleItemListType)
        {
        case FightLayerType.map:
            for (i = 0; i < GridMain.resourceMgr.config_map.data.Count; i++)
            {
                datas.Add(GridMain.resourceMgr.config_map.data[i]);
            }
            break;

        case FightLayerType.monster:
            for (i = 0; i < GridMain.resourceMgr.config_monster.data.Count; i++)
            {
                config_monster_item config_monster = GridMain.resourceMgr.config_monster.data[i];
                datas.Add(config_monster);
            }
            break;

        case FightLayerType.bg:
            for (i = 0; i < GridMain.resourceMgr.config_cell.data.Count; i++)
            {
                config_cell_item config_cell = GridMain.resourceMgr.config_cell.data[i];
                if (config_cell.cell_type == (int)CellType.bg)
                {
                    datas.Add(GridMain.resourceMgr.config_cell.data[i]);
                }
            }
            break;

        case FightLayerType.floor:
            for (i = 0; i < GridMain.resourceMgr.config_cell.data.Count; i++)
            {
                config_cell_item config_cell = GridMain.resourceMgr.config_cell.data[i];
                if (config_cell.cell_type == (int)CellType.floor)
                {
                    datas.Add(GridMain.resourceMgr.config_cell.data[i]);
                }
            }
            break;

        case FightLayerType.cell:
            for (i = 0; i < GridMain.resourceMgr.config_cell.data.Count; i++)
            {
                config_cell_item config_cell = GridMain.resourceMgr.config_cell.data[i];
                if (config_cell.cell_type == (int)CellType.five || config_cell.cell_type == (int)CellType.changer ||
                    config_cell.cell_type == (int)CellType.invade || config_cell.cell_type == (int)CellType.terrain)
                {
                    datas.Add(GridMain.resourceMgr.config_cell.data[i]);
                }
            }
            break;

        case FightLayerType.cell_add:
            for (i = 0; i < GridMain.resourceMgr.config_cell.data.Count; i++)
            {
                config_cell_item config_cell = GridMain.resourceMgr.config_cell.data[i];
                if (config_cell.cell_type == (int)CellType.radiate || config_cell.cell_type == (int)CellType.bomb ||
                    config_cell.cell_type == (int)CellType.timer || config_cell.cell_type == (int)CellType.line_bomb ||
                    config_cell.cell_type == (int)CellType.line_bomb_r || config_cell.cell_type == (int)CellType.three_bomb ||
                    config_cell.cell_type == (int)CellType.three_bomb_r)
                {
                    datas.Add(GridMain.resourceMgr.config_cell.data[i]);
                }
            }
            break;

        case FightLayerType.fence:
            for (i = 0; i < GridMain.resourceMgr.config_wall.data.Count; i++)
            {
                config_wall_item config_wall = GridMain.resourceMgr.config_wall.data[i];
                datas.Add(config_wall);
            }
            break;

        case FightLayerType.cover:
            for (i = 0; i < GridMain.resourceMgr.config_cover.data.Count; i++)
            {
                config_cover_item config_cover = GridMain.resourceMgr.config_cover.data[i];
                datas.Add(config_cover);
            }
            break;

        case FightLayerType.fg:
            for (i = 0; i < GridMain.resourceMgr.config_cell.data.Count; i++)
            {
                config_cell_item config_cell = GridMain.resourceMgr.config_cell.data[i];
                if (config_cell.cell_type == (int)CellType.fg)
                {
                    datas.Add(GridMain.resourceMgr.config_cell.data[i]);
                }
            }
            break;
        }

        for (i = 0; i < datas.Count; i++)
        {
            if (type == FightLayerType.cell || type == FightLayerType.cell_add)
            {
                config_cell_item config_cell = (config_cell_item)datas[i];
                CreateItem(datas[i], FightLayerType.cell, config_cell.rotate);
            }
            else if (type == FightLayerType.monster)
            {
                config_monster_item config_monster = (config_monster_item)datas[i];
                CreateItem(datas[i], type, config_monster.rotate);
            }
            else
            {
                CreateItem(datas[i], type);
            }
        }
    }
Esempio n. 17
0
 public virtual void ShowList()
 {
     list.ClearList();
 }