OSDN Git Service

Added Assets for main menu
[mindgames/Mindgames_main.git] / Mindgames / Library / PackageCache / com.unity.render-pipelines.high-definition@6.9.0-preview / Editor / Lighting / Reflection / Volume / ProxyVolumeUI.cs
1 using System;
2 using UnityEditor.Rendering;
3 using UnityEngine;
4 using UnityEngine.Experimental.Rendering.HDPipeline;
5
6 namespace UnityEditor.Experimental.Rendering.HDPipeline
7 {
8     using CED = CoreEditorDrawer<SerializedProxyVolume>;
9
10     class ProxyVolumeUI
11     {
12         internal static GUIContent shapeContent = EditorGUIUtility.TrTextContent("Shape", "The shape of the Proxy.\nInfinite is compatible with any kind of InfluenceShape.");
13         internal static GUIContent boxSizeContent = EditorGUIUtility.TrTextContent("Box Size", "The size of the box.");
14         internal static GUIContent sphereRadiusContent = EditorGUIUtility.TrTextContent("Sphere Radius", "The radius of the sphere.");
15
16         public static readonly CED.IDrawer SectionShape = CED.Group((serialized, owner) =>
17         {
18             if (serialized.shape.hasMultipleDifferentValues)
19             {
20                 EditorGUI.showMixedValue = true;
21                 EditorGUILayout.PropertyField(serialized.shape, shapeContent);
22                 EditorGUI.showMixedValue = false;
23                 return;
24             }
25             else
26                 EditorGUILayout.PropertyField(serialized.shape, shapeContent);
27
28             switch ((ProxyShape)serialized.shape.intValue)
29             {
30                 case ProxyShape.Box:
31                     EditorGUILayout.PropertyField(serialized.boxSize, boxSizeContent);
32                     break;
33                 case ProxyShape.Sphere:
34                     EditorGUILayout.PropertyField(serialized.sphereRadius, sphereRadiusContent);
35                     break;
36                 case ProxyShape.Infinite:
37                     break;
38                 default: throw new ArgumentOutOfRangeException();
39             }
40         });
41     }
42 }