Exemple #1
0
 void CreateMap(int x, int z)
 {
     if (!hexGrid)
     {
         return;
     }
     hexGrid.CreateMap(x, z);
     if (hexMapCamera)
     {
         hexMapCamera.ValidatePosition();
     }
     Close();
 }
 void Load(string path)
 {
     if (!File.Exists(path))
     {
         Debug.LogError($"File {path} doesn't exist!");
         return;
     }
     using (var reader = new BinaryReader(File.OpenRead(path)))
     {
         int header = reader.ReadInt32();
         if (header <= 1)
         {
             hexGrid.Load(reader, header);
             if (m_Camera)
             {
                 m_Camera.ValidatePosition();
             }
         }
         else
         {
             Debug.LogWarning($"Unknown map format {header}");
         }
     }
 }