public void Awake()
 {
     waterScript    = (WaterToolScript)target as WaterToolScript;
     terComponent   = (Terrain)waterScript.GetComponent(typeof(Terrain));
     terData        = terComponent.terrainData;
     terrainHeights = terData.GetHeights(0, 0, terData.heightmapResolution, terData.heightmapResolution);
 }
 public void Awake()
 {
     waterScript = (WaterToolScript)target as WaterToolScript;
     terComponent = (Terrain) waterScript.GetComponent(typeof(Terrain));
     if(terComponent == null)
         Debug.LogError("This script must be attached to a terrain object - Null reference will be thrown");
     terData = terComponent.terrainData;
     terrainHeights = terData.GetHeights(0, 0, terData.heightmapResolution, terData.heightmapResolution);
 }
 public void Awake()
 {
     waterScript  = (WaterToolScript)target as WaterToolScript;
     terComponent = (Terrain)waterScript.GetComponent(typeof(Terrain));
     if (terComponent == null)
     {
         Debug.LogError("This script must be attached to a terrain object - Null reference will be thrown");
     }
     terData        = terComponent.terrainData;
     terrainHeights = terData.GetHeights(0, 0, terData.heightmapResolution, terData.heightmapResolution);
 }
Exemple #4
0
    public void Start()
    {
        terrainObject  = GameObject.Find(parentTerrain);
        waterScript    = (WaterToolScript)terrainObject.GetComponent("WaterToolScript");
        terComponent   = (Terrain)terrainObject.GetComponent(typeof(Terrain));
        terData        = terComponent.terrainData;
        terrainHeights = terData.GetHeights(0, 0, terData.heightmapResolution, terData.heightmapResolution);

        riverSmooth = 15;

        riverNodeMode = false;
        finalized     = false;
        showHandles   = true;
    }
Exemple #5
0
    public void Start()
    {
        terrainObject = parentTerrain;
        waterScript   = (WaterToolScript)terrainObject.GetComponent("WaterToolScript");
        terComponent  = (Terrain)terrainObject.GetComponent(typeof(Terrain));

        if (terComponent == null)
        {
            Debug.LogError("This script must be attached to a terrain object - Null reference will be thrown");
        }

        terData        = terComponent.terrainData;
        terrainHeights = terData.GetHeights(0, 0, terData.heightmapResolution, terData.heightmapResolution);

        riverSmooth   = 15;
        riverNodeMode = false;
        finalized     = false;
        showHandles   = true;
    }
Exemple #6
0
 public void Awake()
 {
     waterScript = (WaterToolScript)target as WaterToolScript;
 }
    public void Start()
    {
        terrainObject = parentTerrain;
        waterScript = (WaterToolScript)terrainObject.GetComponent("WaterToolScript");
        terComponent = (Terrain) terrainObject.GetComponent(typeof(Terrain));

        if(terComponent == null)
            Debug.LogError("This script must be attached to a terrain object - Null reference will be thrown");

        terData = terComponent.terrainData;
        terrainHeights = terData.GetHeights(0, 0, terData.heightmapResolution, terData.heightmapResolution);

        riverSmooth = 15;
        riverNodeMode = false;
        finalized = false;
        showHandles = true;
    }