public Map2D(Map3D binded) { this.Binded = binded; }
// Use this for initialization. void Start() { // [遊戲素材設定] GlobalAsset.controller = this; // 物件造型. Maze.Animal.SetShape(new Maze.Shape(animalShapes)); Maze.Stone.SetSprite(stoneSprite); Maze.Creater.SetSprite(createrSprite); Maze.Food.SetSprite(foodSprite); Maze.Wall.SetSprite(wallSprite); // 技能音效. Maze.SkillManager.attack = punchAudio; Maze.SkillManager.specialAttack = otherSkillAudio; Maze.SkillManager.build = buildAudio; // 技能造型. GlobalAsset.gridSprites = gridSprites; GlobalAsset.attack = attack; GlobalAsset.straight = straight; GlobalAsset.horizon = horizon; GlobalAsset.create = create; // 小地圖標示. GlobalAsset.playerMark = playerMark; GlobalAsset.createrMark = createrMark; // UI提示框. GlobalAsset.positionHint = positionHint; GlobalAsset.hintBox = hintBox; GlobalAsset.talkBox = talkBox; // [遊戲地圖設定] // 放幾個gridSprite就生成幾層世界. gameMap = new Maze.Map3D(GlobalAsset.mapSize, GlobalAsset.mapSize, gridSprites.Length); sceneMap = new Maze.Map2D(gameMap); Maze.MazeObject.SetMaze(gameMap); // [劇情] storyManager = new Story.StoryManager(); // 在每個平面執行動作. for (int layer = 0; layer < Maze.MazeObject.World.Layers; ++layer) { // 創造6個不同顏色的村莊. for (int i = 0; i < 6; ++i) { Maze.Point3D position = gameMap.GetRandomPointOn(layer); Maze.Creater creater = new Maze.Creater(position, GlobalAsset.colors[i]); if (gameMap.GetAt(position).InsertObj(creater)) { GlobalAsset.creaters.Add(creater); creater.FullEnergy(); // 在每個村莊生成3隻村民. creater.createAnimals(3); } else // 這個位置已經有東西了. { --i; } } } // clock 歸零. timer = 0; }
static public void SetMaze(Map3D world) { MazeObject.World = world; }