public void LoadGrid() { if (terrainGrid == null) { terrainGrid = Instantiate(terrainGameObject, Vector3.zero, Quaternion.identity).GetComponent <RegionTerrain>(); } terrainGrid.ReDoDictionary(); LoadVariable(); }
public void CreateGrid() { GameObject plane = new GameObject("BaseTerrain", typeof(RegionTerrain)); plane.AddComponent <MeshFilter>(); MeshRenderer e = plane.AddComponent <MeshRenderer>(); plane.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); //plane.GetComponent<GridTerrain>().CreateGrid(xcellSize, ycellSize, mapSize); terrainGrid = plane.GetComponent <RegionTerrain>(); terrainMesh = terrainGrid.Init(xcellSize, ycellSize, mapSize, this); }
public void InitLevel(Vector3 position, Transform levelParent) { terrainGrid = Instantiate(terrainGameObject, position, Quaternion.identity, levelParent).GetComponent <RegionTerrain>(); terrainGrid.ReDoDictionary(); }