Exemple #1
0
    // 復帰
    public void ReCreate()
    {
        List <TroutData> datalist = GlobalDataManager.GetGlobalData().LoadTroutData();

        for (int i = 0; i < datalist.Count; i++)
        {
            Trout2 trout = Instantiate(troutObj, Vector3.zero, Quaternion.Euler(0, 0, 0)) as Trout2;
            trout.ReCreate(datalist[i]);
            trout.name = "MapTrout";
            troutList.Add(trout);
        }
        List <EnemyData> enemylist = GlobalDataManager.GetGlobalData().LoadEnemyDataList();

        Debug.Log("敵を" + enemylist.Count + "体再出現させます。");
        for (int i = 0; i < enemylist.Count; i++)
        {
            EnemyField enemy = Instantiate(enemyObj, enemylist[i].Position, Quaternion.Euler(0, 0, 0)) as EnemyField;
            enemy.Manager = this;
            enemy.Target  = playerOwner.gameObject;
            enemy.FirstAreaCheck();
            enemyList.Add(enemy);
        }
        playerOwner.Manager = this;
        playerOwner.Respawn();
    }
Exemple #2
0
    // ステージの作成
    public void Create(int size)
    {
        Debug.Log("ダンジョンの生成を開始します。");
        GlobalDataManager.GetGlobalData().OnReload();
        // ここ以外で値の変更はしない
        DUNGEON_SIZE = size;

        // 区画の生成
        CreateArea();
        // ルートの生成
        CreateRoute();
        // 道の生成
        CreateRoad();
        // 袋小路の生成
        CreateBlindAlley();

        // ダンジョンデータ生成後マスの生成
        for (int i = 0; i < areaList.Count; i++)
        {
            List <TroutData> trout_list = areaList[i].GetTroutDataList();
            for (int n = 0; n < trout_list.Count; n++)
            {
                troutDataList.Add(trout_list[n]);
            }
        }
        for (int i = 0; i < roadList.Count; i++)
        {
            List <TroutData> trout_list = roadList[i].GetTroutDataList();
            for (int n = 0; n < trout_list.Count; n++)
            {
                troutDataList.Add(trout_list[n]);
            }
        }
        for (int i = 0; i < troutDataList.Count; i++)
        {
            troutDataList[i].ID = i;
            Trout2 trout = Instantiate(troutObj, troutDataList[i].Position, troutDataList[i].Rotation) as Trout2;
            trout.ReCreate(troutDataList[i]);
            trout.name = "MapTrout";
            GlobalDataManager.GetGlobalData().SaveTroutData(troutDataList[i]);
            troutList.Add(trout);
        }

        for (int i = 0; i < enemyList.Count; i++)
        {
            enemyList[i].FirstAreaCheck();
        }

        playerOwner.IsVisiblePlayer(true);
        playerOwner.ResetSetUpPlayerCamera();
        playerOwner.Manager = this;
        playerOwner.FirstAreaCheck();
        Debug.Log("ダンジョンの生成を終了しました。");
    }