// 关卡重置的时候只要调用List.clear就行 //整个游戏的初始化 void Awake() { //防止手机熄灭屏幕 Screen.sleepTimeout = SleepTimeout.NeverSleep; TowerInfo.Init(); TowerElemInfo.Init(); int[,] map = new int[7, 7] { { 1, 1, 1, 1, 1, 1, 1 }, { 1, 0, 1, 0, 0, 0, 1 }, { 1, 0, 1, 0, 1, 0, 1 }, { 1, 0, 0, 0, 0, 0, 1 }, { 1, 0, 1, 1, 0, 0, 1 }, { 1, 0, 0, 0, 1, 0, 1 }, { 1, 1, 1, 1, 1, 1, 1 } }; //测试 MapType[,] mapTemp = new MapType[7, 7]; for (int i = 0; i < 7; i++) { for (int j = 0; j < 7; j++) { mapTemp[i, j] = (MapType)map[i, j]; } } Point start = new Point(5, 3); Point end = new Point(5, 5); Point[] pointA = new Point[2] { new Point(1, 12), new Point(1, 12) }; Point[] pointB = new Point[2] { start, end }; //AStar.Maze maze = new AStar.Maze(mapTemp, 7, 7, start, end, pointA, pointB); //maze.FindFinalPath(); //Debug.Log("Print path:"); //monsterPathFinding.monsterPathFinding(map, 5, 3, 5, 5); }