コード例 #1
0
    void CreateMap(int x, int z)
    {
        if (generateMaps)
        {
            mapGenerator.GenerateMap(x, z);
        }
        else
        {
            hexGrid.CreateMap(x, z);
        }

        TacticalCamera_Script.ValidatePosition();
        Close();
    }
コード例 #2
0
 void Load(string path)
 {
     if (!File.Exists(path))
     {
         Debug.LogError("File does not exist: " + path);
         return;
     }
     using (BinaryReader reader = new BinaryReader(File.OpenRead(path)))
     {
         int header = reader.ReadInt32();
         if (header == mapVersionNumber)
         {
             hexGrid.Load(reader);
             TacticalCamera_Script.ValidatePosition();
         }
         else
         {
             Debug.LogWarning("Unknown map format " + header);
         }
     }
 }