コード例 #1
0
        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;
        }
コード例 #2
0
 public static void ApplyColorGradient(StylizedWaterURP water)
 {
     water.colorGradientTexture = GradientTextureMaker.CreateGradientTexture(water.material, water.colorGradient);
     water.material.SetTexture("_ColorGradientTexture", water.colorGradientTexture);
 }