public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        PerlinTerrain terrain = (PerlinTerrain)target;

        if (GUILayout.Button("Regenerate"))
        {
            terrain.Regenerate();
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     terrainManager    = Instantiate(terrainManager, this.transform);
     creatures         = new List <Creature>();
     resources         = new List <IResource>();
     resourcesToRemove = new List <IResource>();
     creaturesToRemove = new List <Creature>();
     creatureManager   = new GameObject("Creatures");
     resourceManager   = new GameObject("Resources");
     creatureManager.transform.SetParent(this.transform);
     resourceManager.transform.SetParent(this.transform);
 }
    void Start()
    {
        PerlinTerrain tp = tilePrefab.GetComponent <PerlinTerrain>();

        if (tp != null)
        {
            quadsPerTile = tp.quadsPerTile;
        }

        if (player == null)
        {
            player = Camera.main.transform;
        }

        StartCoroutine(GenerateWorld());
    }
 private void Start()
 {
     _terrainMesh = PerlinTerrain.GetMesh(_widthTerrain, _heightTerrain, _widthSize, _heightSize, _trueHeighMultiplier, _perlinXMultiplier, _perlinYMultiplier);
     _mf.mesh     = _terrainMesh;
 }