打包过程出现的问题

This commit is contained in:
2024-12-31 16:40:03 +08:00
parent 389a1bdde9
commit 22c0d4f742
10 changed files with 406 additions and 39 deletions
@@ -0,0 +1,31 @@
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(ConditionalFieldAttribute))]
public class ConditionalFieldDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
ConditionalFieldAttribute conditional = (ConditionalFieldAttribute)attribute;
SerializedProperty conditionProperty = property.serializedObject.FindProperty(conditional.conditionField);
if (conditionProperty != null && conditionProperty.boolValue)
{
EditorGUI.PropertyField(position, property, label, true);
}
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
ConditionalFieldAttribute conditional = (ConditionalFieldAttribute)attribute;
SerializedProperty conditionProperty = property.serializedObject.FindProperty(conditional.conditionField);
if (conditionProperty != null && conditionProperty.boolValue)
{
return EditorGUI.GetPropertyHeight(property, label, true);
}
return 0f; // 隐藏字段时的高度
}
}