void Update()
    {
        // 移動中のモンスター処理
        if (monsterMover != null)
        {
            monsterMover.Step();

            bool isFinished = monsterMover.isFinished();

            if (isFinished)
            {
                // 視界
                BattleMapUnmasker unmasker = new BattleMapUnmasker(holder, mapObjectGenerator);
                unmasker.Unmask(monsterMover.GetTargetMonster());

                // ボードの更新
                commandController.UpdateActionBoard();

                // ステータスの非表示
                statusGenerator.HideStatus();

                monsterMover = null;
            }
        }
    }
Beispiel #2
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);
    }