Improved the culling result of HizCulling;

Added custom inspector for VolumeObject;
Change the name of AoVolume to VolumeObject;
This commit is contained in:
2025-02-24 00:22:04 +09:00
parent 833502f87c
commit 2f79df128e
23 changed files with 336 additions and 86 deletions

View File

@@ -0,0 +1,36 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Misaki.AoVolume.Editor
{
[CustomPropertyDrawer(typeof(PopupBooleanAttribute))]
public class PopupBooleanDrawer : PropertyDrawer
{
private static readonly GUIContent[] _popupContent = { new("False"), new("True") };
private static readonly List<bool> _popupOptions = new() { false, true };
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var value = property.boolValue;
var index = value ? 1 : 0;
EditorGUI.BeginChangeCheck();
index = EditorGUI.Popup(position, label, index, _popupContent);
if (EditorGUI.EndChangeCheck())
{
property.boolValue = index == 1;
}
}
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var popupField = new PopupField<bool>(property.displayName, _popupOptions, false);
popupField.AddToClassList(PopupField<bool>.alignedFieldUssClassName);
popupField.bindingPath = property.propertyPath;
return popupField;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 60948f0da82ab5849b3df0b869031b01