/// <summary>
    /// チームの初期化
    /// </summary>
    /// <param name="index"></param>
    private void InitTeam(int index)
    {
        // チーム
        BattleMapTeam team = new BattleMapTeam();

        team.Index = index;

        BattleMapTeamColorType teamColor = (BattleMapTeamColorType)Enum.ToObject(typeof(BattleMapTeamColorType), index);

        team.TeamColor = teamColor;

        // コマンドボード
        BattleMapCommandBoard commandBoard = commandGenerator.CreateCommandBoard();

        team.CommandBoard = commandBoard;

        // TODO: とりあえず先頭以外は非活性
        if (index != 0)
        {
            commandBoard.GameObject.SetActive(false);
        }

        // チームの追加
        BattleMapTeams teams = holder.BattleMapTeams;

        teams.TeamList.Add(team);
    }
Exemple #2
0
    public BattleMapTeam GetByColor(BattleMapTeamColorType colorType)
    {
        //foreach (BattleMapTeam team in teamList)
        //{
        //    if (team.TeamColor == colorType)
        //    {
        //        return team;
        //    }
        //}

        BattleMapTeam team = teamList.First(t => t.TeamColor == colorType);

        return(team);
    }
Exemple #3
0
    /// <summary>
    /// モンスターの設置
    /// </summary>
    /// <param name="bmt"></param>
    public void InstallMonster(BattleMapTile bmt)
    {
        List <BattleMapMonster> monsterList = holder.BattleMapMonsters.MonsterList;

        // 既にいたら除去
        int existIndex = -1;

        for (int i = 0; i < monsterList.Count; i++)
        {
            BattleMapMonster bmm = monsterList[i];
            if (bmt.X == bmm.X && bmt.Y == bmm.Y)
            {
                existIndex = i;
            }
        }

        // いる場合は除去して終了
        if (0 <= existIndex)
        {
            BattleMapMonster bmm = monsterList[existIndex];
            Destroy(bmm.GameObject);
            monsterList.Remove(bmm);

            // マーカーを除去
            mapIconGenerator.UninstallMonsterMarker(bmm);

            return;
        }

        // モンスターのタイプ
        BattleMapMonsterType monsterType = GetMonsterTypeByDropdown();

        // 作成
        BattleMapMonster monster = new BattleMapMonster();

        monster.Id = "" + index;
        index++;
        monster.X         = bmt.X;
        monster.Y         = bmt.Y;
        monster.Name      = GetMonsterName(monsterType);
        monster.ClassName = GetMonsterClassName(monsterType);
        GameObject go = GetMonsterGameObject(bmt, monsterType);

        monster.GameObject = go;

        // スキル
        monster.SkillList        = CreateMonsterSkillList();
        monster.CounterSkillList = CreateMonsterCounterSkillList();

        // チーム
        BattleMapTeam team = GetTeamByDropdown();

        monster.Team = team;

        // ステータスの作成
        BattleMapMonsterStatus monsterStatus = new BattleMapMonsterStatus();

        monsterStatus.MoveCount   = 3;
        monsterStatus.MonsterType = monsterType;

        monster.BattleStatus = monsterStatus;

        // 位置の調整
        ConditionMonsterPosition(bmt, monster);

        // ホルダーに追加
        monsterList.Add(monster);

        // サークルの設定
        mapIconGenerator.InstallMonsterMarker(monster);

        // 視界の設定
        BattleMapUnmasker unmasker = new BattleMapUnmasker(holder, mapObjectGenerator);

        unmasker.Unmask(monster);
    }