示例#1
0
 /// <summary>
 /// Load hex map
 /// </summary>
 private void Load(string path)
 {
     if (!File.Exists(path))
     {
         Debug.LogError("File does not exist " + path);
         return;
     }
     using (BinaryReader reader = new BinaryReader(File.Open(path, FileMode.Open)))
     {
         int header = reader.ReadInt32();
         if (header <= 2)
         {
             hexGrid.Load(reader, header);
             HexMapCamera.ValidatePosition();
         }
         else
         {
             Debug.LogWarning("Unknown map format " + header);
         }
     }
 }
示例#2
0
 private void CreateMap(int x, int z)
 {
     hexGrid.CreateMap(x, z);
     HexMapCamera.ValidatePosition();
     Close();
 }
示例#3
0
 private void Awake()
 {
     instance = this;
     swivel   = transform.GetChild(0);
     stick    = swivel.GetChild(0);
 }