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"); } }
private void Awake() { _instance = this; _swivel = transform.GetChild(0); _stick = _swivel.GetChild(0); }
private void CreateMap(int x, int z) { HexGrid.CreateMap(x, z); HexCamera.ValidatePosition(); OnClose(); }