public bool CreateMap() { loadedMap = new Map(); Chunk chunk = new Chunk(); //chunk.Load(loadedMap, gameObject); DrawTerrainMesh(); return true; }
public bool Load(Map map, GameObject go) { LoadTerrain(map.terrain, go); return true; }
public bool CloseMap() { loadedMap = null; return true; }
public Cell(int _x, int _z, Map _map) { x = _x; z = _z; map = _map; }
public bool LoadMap(string path = "") { if (path == "") { path = EditorUtility.OpenFilePanel( "Load Map", Application.dataPath, "map"); } if (path.Length != 0 && File.Exists(path)) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(path, FileMode.Open); MapSaveData msd = (MapSaveData)bf.Deserialize(file); if (loadedMap == null) loadedMap = new Map(); loadedMap.Import(msd); file.Close(); loadedMap.name = Path.GetFileNameWithoutExtension(path); //EditorUtility.SetDirty(this); // Chunk Chunk chunk = new Chunk(); //chunk.Load(loadedMap, gameObject); // Mesh DrawTerrainMesh(); } return true; }