20240422
This commit is contained in:
commit
e0afef912e
1285 files changed
+83219
No files matched your search
@@ -0,0 +1,34 @@
|
||||
namespace Mapbox.Editor
|
||||
{
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Mapbox.Unity.Map;
|
||||
|
||||
[CustomPropertyDrawer(typeof(UnityLayerOptions))]
|
||||
public class UnityLayerOptionsDrawer : PropertyDrawer
|
||||
{
|
||||
static float lineHeight = EditorGUIUtility.singleLineHeight;
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var addtoLayerProp = property.FindPropertyRelative("addToLayer");
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), addtoLayerProp, new GUIContent { text = "Add to Unity layer" });
|
||||
if (addtoLayerProp.boolValue == true)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
var layerId = property.FindPropertyRelative("layerId");
|
||||
layerId.intValue = EditorGUILayout.LayerField("Layer", layerId.intValue);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
// Reserve space for the total visible properties.
|
||||
return 1.0f * lineHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user