void Update() { if (transform.eulerAngles != lastEuler) { shaderScript.ApplyLighting(); lastEuler = transform.eulerAngles; } }
public override void OnInspectorGUI() { //base.OnInspectorGUI(); TerrainShader shader = (TerrainShader)target; if (DrawDefaultInspector()) { if (shader.autoUpdateLighting) { shader.ApplyLighting(); } if (shader.autoUpdateTerrain) { shader.ApplyTerrain(); } if (shader.autoUpdateTextures) { shader.ApplyTextures(); } } }