Exemple #1
0
        public void Load()
        {
            var path = Path.Combine(Application.temporaryCachePath, "test.map");

            using (var reader = new BinaryReader(File.OpenRead(path)))
            {
                var header = reader.ReadInt32();

                if (header == 0)
                {
                    HexGrid.Load(reader);
                    HexCamera.ValidatePosition();
                }
                else
                {
                    Debug.LogError($"Unknown map format {header}");
                }
                reader.Dispose();
                Debug.Log("Load map success");
            }
        }
Exemple #2
0
 private void CreateMap(int x, int z)
 {
     HexGrid.CreateMap(x, z);
     HexCamera.ValidatePosition();
     OnClose();
 }