Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            bool   willDrawGUI = false;
            string msg         = null;

            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Builtin)
            {
#if UNITY_POST_PROCESSING_STACK_V2
                willDrawGUI = true;
#else
                msg = "Please install Post Processing Stack V2 to setup water effect";
#endif
            }
            else if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Universal)
            {
#if POSEIDON_URP
                willDrawGUI = true;
#endif
            }
            else
            {
                willDrawGUI = false;
                msg         = "Water effect doesn't support custom render pipeline.";
            }

            if (!willDrawGUI)
            {
                EditorGUILayout.LabelField(msg, PEditorCommon.WordWrapItalicLabel);
                return;
            }

#if POSEIDON_URP
            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Universal)
            {
                if (!CheckRendererFeatureConfig())
                {
                    EditorGUILayout.LabelField("Please add a Water Effect Renderer Feature to the current URP Asset to setup water effect.", PEditorCommon.WordWrapItalicLabel);
                    return;
                }
            }
#endif

            instance.Water   = EditorGUILayout.ObjectField("Water", instance.Water, typeof(PWater), true) as PWater;
            instance.Profile = PEditorCommon.ScriptableObjectField <PWaterFXProfile>("Profile", instance.Profile);

            if (instance.Water == null || instance.Profile == null)
            {
                return;
            }
            DrawVolumesGUI();
            EditorGUI.BeginChangeCheck();
            PWaterFXProfileInspectorDrawer.Create(instance.Profile, instance.Water).DrawGUI();
            if (EditorGUI.EndChangeCheck())
            {
                instance.UpdatePostProcessOrVolumeProfile();
            }
            DrawEventsGUI();
        }
Esempio n. 2
0
 public override void OnInspectorGUI()
 {
     PWaterFXProfileInspectorDrawer.Create(instance, null).DrawGUI();
 }