예제 #1
0
 void RemoveAndUnstoreWalls(List <Transform> walls)
 {
     /*
      *  遍历墙
      *  {
      *      清除墙
      *      清除列表里的记录
      *  }
      */
     foreach (Transform wall in walls)
     {
         MPool.Set(wall.gameObject);
         _walls.Remove(wall);
     }
 }
예제 #2
0
 void SpownAndStoreWalls(List <Vector2Int> positions)
 {
     /*
      *  遍历位置
      *      if(这个位置没有墙)
      *      {
      *          生成墙
      *          加入列表
      *      }
      */
     foreach (Vector2Int position in positions)
     {
         if (!HaveWall(position))
         {
             GameObject wall = MPool.Get(_wall, new Vector3(position.x, WALL_Y, position.y), Quaternion.identity);
             _walls.Add(wall.transform);
         }
     }
 }