public void OnEnable() { selected = Selection.activeGameObject; if (!selected) { return; } if (!stylizedWater) { stylizedWater = selected.GetComponent <StylizedWaterURP>(); } if (stylizedWater) { serializedObject = new SerializedObject(stylizedWater); GetWaterProperties(); } Undo.undoRedoPerformed += ApplyChanges; }
public static void ApplyColorGradient(StylizedWaterURP water) { water.colorGradientTexture = GradientTextureMaker.CreateGradientTexture(water.material, water.colorGradient); water.material.SetTexture("_ColorGradientTexture", water.colorGradientTexture); }