20240422
This commit is contained in:
commit
e0afef912e
1285 files changed
+83219
No files matched your search
@@ -0,0 +1,35 @@
|
||||
namespace Mapbox.Editor
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using Mapbox.Unity.MeshGeneration.Factories;
|
||||
|
||||
[CustomEditor(typeof(MapImageFactory))]
|
||||
public class MapImageFactoryEditor : FactoryEditor
|
||||
{
|
||||
public SerializedProperty layerProperties;
|
||||
private MonoScript script;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
layerProperties = serializedObject.FindProperty("_properties");
|
||||
script = MonoScript.FromScriptableObject((MapImageFactory)target);
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
GUI.enabled = false;
|
||||
script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript;
|
||||
GUI.enabled = true;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(layerProperties);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user