5 namespace droid.Runtime.Shaders.Experimental.Skybox_Shaders.Editor {
6 public class GradientSkyboxInspector : MaterialEditor {
7 public override void OnInspectorGUI() {
8 this.serializedObject.Update();
11 EditorGUI.BeginChangeCheck();
13 this.ColorProperty(GetMaterialProperty(this.targets,
"_Color2"),
"Top Color");
14 this.ColorProperty(GetMaterialProperty(this.targets,
"_Color1"),
"Bottom Color");
15 this.FloatProperty(GetMaterialProperty(this.targets,
"_Intensity"),
"Intensity");
16 this.FloatProperty(GetMaterialProperty(this.targets,
"_Exponent"),
"Exponent");
18 var dp = GetMaterialProperty(this.targets,
"_UpVectorPitch");
19 var dy = GetMaterialProperty(this.targets,
"_UpVectorYaw");
21 if (dp.hasMixedValue || dy.hasMixedValue) {
22 EditorGUILayout.HelpBox(
"Editing angles is disabled because they have mixed values.",
25 this.FloatProperty(dp,
"Pitch");
26 this.FloatProperty(dy,
"Yaw");
29 if (EditorGUI.EndChangeCheck()) {
30 var rp = dp.floatValue * Mathf.Deg2Rad;
31 var ry = dy.floatValue * Mathf.Deg2Rad;
33 var up_vector =
new Vector4(Mathf.Sin(rp) * Mathf.Sin(ry),
35 Mathf.Sin(rp) * Mathf.Cos(ry),
37 GetMaterialProperty(this.targets,
"_UpVector").vectorValue = up_vector;
39 this.PropertiesChanged();