/// <summary>
    /// 移動の終了
    /// </summary>
    private void FinishMove()
    {
        BattleMapMonster monster = holder.BattleMapStatus.BattleMapMoveStatus.TargetMonster;

        // マーカーを削除
        mapIconGenerator.UninstallMonsterMarker(monster);

        // モンスターを移動
        BattleMapTile endTile = holder.BattleMapStatus.BattleMapMoveStatus.GetEndMapTile();

        monster.X = endTile.X;
        monster.Y = endTile.Y;

        // モンスターのリセット
        // 傾き、移動で位置がずれるため
        monsterGenerator.ResetMonsterGameObject(monster);

        // sortingOrderを再設定
        monsterGenerator.SetMonsterSortingOrder(monster);

        // マーカーを作り直す
        mapIconGenerator.InstallMonsterMarker(monster);

        // 移動パスの削除
        moveProcessor.ClearFlameAndPath();

        // ステータスの削除
        holder.BattleMapStatus.BattleMapMoveStatus = null;

        // 現在のチームの選択されているコマンド
        BattleMapCommand command = holder.GetCurrentCommand();

        command.Count = command.Count - 1;
    }
예제 #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);
    }