Beispiel #1
0
 private void OnEnable()
 {
     this.m_Type                = base.serializedObject.FindProperty("m_Type");
     this.m_Range               = base.serializedObject.FindProperty("m_Range");
     this.m_SpotAngle           = base.serializedObject.FindProperty("m_SpotAngle");
     this.m_CookieSize          = base.serializedObject.FindProperty("m_CookieSize");
     this.m_Color               = base.serializedObject.FindProperty("m_Color");
     this.m_Intensity           = base.serializedObject.FindProperty("m_Intensity");
     this.m_BounceIntensity     = base.serializedObject.FindProperty("m_BounceIntensity");
     this.m_ColorTemperature    = base.serializedObject.FindProperty("m_ColorTemperature");
     this.m_UseColorTemperature = base.serializedObject.FindProperty("m_UseColorTemperature");
     this.m_Cookie              = base.serializedObject.FindProperty("m_Cookie");
     this.m_ShadowsType         = base.serializedObject.FindProperty("m_Shadows.m_Type");
     this.m_ShadowsStrength     = base.serializedObject.FindProperty("m_Shadows.m_Strength");
     this.m_ShadowsResolution   = base.serializedObject.FindProperty("m_Shadows.m_Resolution");
     this.m_ShadowsBias         = base.serializedObject.FindProperty("m_Shadows.m_Bias");
     this.m_ShadowsNormalBias   = base.serializedObject.FindProperty("m_Shadows.m_NormalBias");
     this.m_ShadowsNearPlane    = base.serializedObject.FindProperty("m_Shadows.m_NearPlane");
     this.m_Halo                = base.serializedObject.FindProperty("m_DrawHalo");
     this.m_Flare               = base.serializedObject.FindProperty("m_Flare");
     this.m_RenderMode          = base.serializedObject.FindProperty("m_RenderMode");
     this.m_CullingMask         = base.serializedObject.FindProperty("m_CullingMask");
     this.m_Lightmapping        = base.serializedObject.FindProperty("m_Lightmapping");
     this.m_AreaSizeX           = base.serializedObject.FindProperty("m_AreaSize.x");
     this.m_AreaSizeY           = base.serializedObject.FindProperty("m_AreaSize.y");
     this.m_BakedShadowRadius   = base.serializedObject.FindProperty("m_ShadowRadius");
     this.m_BakedShadowAngle    = base.serializedObject.FindProperty("m_ShadowAngle");
     this.UpdateShowOptions(true);
     if (this.m_KelvinGradientTexture == null)
     {
         this.m_KelvinGradientTexture = LightEditor.CreateKelvinGradientTexture("KelvinGradientTexture", 300, 16, 1000f, 20000f);
     }
 }
Beispiel #2
0
 private void CommandBufferGUI()
 {
     if (base.targets.Length == 1)
     {
         Light light = base.target as Light;
         if (!(light == null))
         {
             int commandBufferCount = light.commandBufferCount;
             if (commandBufferCount != 0)
             {
                 this.m_CommandBuffersShown = GUILayout.Toggle(this.m_CommandBuffersShown, GUIContent.Temp(commandBufferCount + " command buffers"), EditorStyles.foldout, new GUILayoutOption[0]);
                 if (this.m_CommandBuffersShown)
                 {
                     EditorGUI.indentLevel++;
                     LightEvent[] array = (LightEvent[])Enum.GetValues(typeof(LightEvent));
                     for (int i = 0; i < array.Length; i++)
                     {
                         LightEvent      lightEvent     = array[i];
                         CommandBuffer[] commandBuffers = light.GetCommandBuffers(lightEvent);
                         CommandBuffer[] array2         = commandBuffers;
                         for (int j = 0; j < array2.Length; j++)
                         {
                             CommandBuffer commandBuffer = array2[j];
                             using (new GUILayout.HorizontalScope(new GUILayoutOption[0]))
                             {
                                 Rect rect = GUILayoutUtility.GetRect(GUIContent.none, EditorStyles.miniLabel);
                                 rect.xMin += EditorGUI.indent;
                                 Rect removeButtonRect = LightEditor.GetRemoveButtonRect(rect);
                                 rect.xMax = removeButtonRect.x;
                                 GUI.Label(rect, string.Format("{0}: {1} ({2})", lightEvent, commandBuffer.name, EditorUtility.FormatBytes(commandBuffer.sizeInBytes)), EditorStyles.miniLabel);
                                 if (GUI.Button(removeButtonRect, LightEditor.s_Styles.iconRemove, LightEditor.s_Styles.invisibleButton))
                                 {
                                     light.RemoveCommandBuffer(lightEvent, commandBuffer);
                                     SceneView.RepaintAll();
                                     GameView.RepaintAll();
                                     GUIUtility.ExitGUI();
                                 }
                             }
                         }
                     }
                     using (new GUILayout.HorizontalScope(new GUILayoutOption[0]))
                     {
                         GUILayout.FlexibleSpace();
                         if (GUILayout.Button("Remove all", EditorStyles.miniButton, new GUILayoutOption[0]))
                         {
                             light.RemoveAllCommandBuffers();
                             SceneView.RepaintAll();
                             GameView.RepaintAll();
                         }
                     }
                     EditorGUI.indentLevel--;
                 }
             }
         }
     }
 }