Esempio n. 1
0
 public void LoadGrid()
 {
     if (terrainGrid == null)
     {
         terrainGrid = Instantiate(terrainGameObject, Vector3.zero, Quaternion.identity).GetComponent <RegionTerrain>();
     }
     terrainGrid.ReDoDictionary();
     LoadVariable();
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void InitLevel(Vector3 position, Transform levelParent)
 {
     terrainGrid = Instantiate(terrainGameObject, position, Quaternion.identity, levelParent).GetComponent <RegionTerrain>();
     terrainGrid.ReDoDictionary();
 }