Пример #1
0
 void CheckField()
 {
     if (terrain == null)
     {
         terrain = target as UTerrain;
     }
     if (texture == null)
     {
         texture = new UTextureEditor(this);
     }
     if (tree == null)
     {
         tree = new UTreeEditor(this);
     }
     if (grass == null)
     {
         grass = new UGrassEditor(this);
     }
     if (height == null)
     {
         height = new UHeightEditor(this);
     }
     if (settings == null)
     {
         settings = new USettingsEditor(this);
     }
     if (about == null)
     {
         about = new UAboutEditor();
     }
 }
Пример #2
0
    public GameObject createTerrain(USlippyTile tile, string key)
    {
        GameObject t = new GameObject(key);

        if (genTerrain)
        {
            /// crete the TerrainData
            TerrainData tData = new TerrainData();
            tData.size = new Vector3(chunkSize / 8, 0, chunkSize / 8); // don't know why 8, but terrain its 8 times bigger than this numbers

            /// add the terrain Collider and the Terrain based in the TerrainData
            TerrainCollider tColliderComp = t.AddComponent <TerrainCollider>();
            Terrain         tComp         = t.AddComponent <Terrain>();
            tColliderComp.terrainData = tData;
            tComp.terrainData         = tData;

            /// change the terrain material
            tComp.materialType = Terrain.MaterialType.BuiltInLegacySpecular;

            /// create and init the UTerrain that will load the height data
            UTerrain uTerrain = t.AddComponent <UTerrain>();
            uTerrain.init(tile, this);
        }

        if (genOSM)
        {
            /// create and init the UTerrain that will load the height data
            OSMChunk osmChunk = t.AddComponent <OSMChunk>();
            osmChunk.init(tile, this);
        }

        if (genOSM && debugOSM)
        {
            /// only for debug visualization
            OSMDebug visualization = t.AddComponent <OSMDebug>();
        }

        //t.AddComponent<AssignSplatMap>();

        return(t);
    }
Пример #3
0
 public USettingsEditor(UTerrainInspector editor)
 {
     terrain = editor.terrain;
 }