示例#1
0
 public void LoadLevel()
 {
     if (File.Exists(GetLevelPath()))
     {
         byte[] levelBytes = File.ReadAllBytes(GetLevelPath());
         if (pathfinder.worldData != null)
         {
             pathfinder.worldData = WorldData.Load(levelBytes);
         }
     }
 }
示例#2
0
 public void LoadOnlyCostField()
 {
     if (File.Exists(GetLevelPath()))
     {
         byte[] levelBytes = File.ReadAllBytes(GetLevelPath());
         if (pathfinder.worldData != null)
         {
             pathfinder.worldData.CostFields = WorldData.Load(levelBytes).CostFields;
         }
     }
     else
     {
         Debug.Log("Load new level");
     }
 }