public override void OnInspectorGUI() { if (FadeToSkybox.CheckSkybox()) { serializedObject.Update(); EditorGUILayout.PropertyField(_useRadialDistance); EditorGUILayout.PropertyField(_startDistance); serializedObject.ApplyModifiedProperties(); } else { EditorGUILayout.HelpBox("This component only supports cubed skyboxes.", MessageType.Warning); } }
public override void OnInspectorGUI() { bool componentSupported = true; if (!FadeToSkybox.CheckSkybox()) { EditorGUILayout.HelpBox("This component only supports cubed skyboxes.", MessageType.Warning); componentSupported = false; } if (!RenderSettings.fog) { EditorGUILayout.HelpBox("This component requires fog to be enabled (Window -> Lighting -> Fog).", MessageType.Warning); componentSupported = false; } if (componentSupported) { serializedObject.Update(); EditorGUILayout.PropertyField(_useRadialDistance); EditorGUILayout.PropertyField(_startDistance); serializedObject.ApplyModifiedProperties(); } }