コード例 #1
0
ファイル: ChunkModeChanger.cs プロジェクト: yazici/FRONTIERS
    protected IEnumerator LoadChunk()
    {
        /*Terrain newTerrain = null;
         * while (!GameWorld.Get.ClaimTerrain (out newTerrain)) {
         *      if (Chunk.TargetMode == ChunkMode.Unloaded) {
         *              yield break;
         *      } else {
         *              yield return null;
         *      }
         * }
         * //un-set the terrain neighbors while we move the terrain
         * GameWorld.Get.DetatchChunkNeighbors ();
         * yield return StartCoroutine (Chunk.GenerateTerrain (newTerrain, !Player.Local.Surroundings.IsUnderground));
         * //now re-set the neighbors
         * GameWorld.Get.ReattachChunkNeighbors ();
         * var refreshTerrainTextures = Chunk.RefreshTerrainTextures ();
         * while (refreshTerrainTextures.MoveNext ()) {
         *      yield return refreshTerrainTextures.Current;
         * }*/

        if (Chunk.TargetMode == ChunkMode.Unloaded)
        {
            yield break;
        }

        var addRivers = Chunk.AddRivers(ChunkMode.Immediate);

        while (addRivers.MoveNext())
        {
            yield return(addRivers.Current);
        }

        yield break;
    }