1
This commit is contained in:
20
Unity/Scripts/Sensor/Editor/Editor.BITKit.Sensor.asmdef
Normal file
20
Unity/Scripts/Sensor/Editor/Editor.BITKit.Sensor.asmdef
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "BITKit.Sensor.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:a209c53514018594f9f482516f2a6781",
|
||||
"GUID:508392158bd966c4d9c21e19661a441d",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [
|
||||
"UNITY_EDITOR"
|
||||
],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
0
Unity/Scripts/Sensor/Editor/SensorDrawer.cs
Normal file
0
Unity/Scripts/Sensor/Editor/SensorDrawer.cs
Normal file
47
Unity/Scripts/Sensor/Editor/SensorInspector.cs
Normal file
47
Unity/Scripts/Sensor/Editor/SensorInspector.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
namespace BITKit.Sensors.Editors
|
||||
{
|
||||
/* [CustomEditor(typeof(Sensor), true)]
|
||||
public class SensorInspecer : Editor
|
||||
{
|
||||
public override VisualElement CreateInspectorGUI()
|
||||
{
|
||||
VisualElement container = new();
|
||||
InspectorElement.FillDefaultInspector(container, serializedObject, this);
|
||||
|
||||
var sensor = serializedObject.targetObject as Sensor;
|
||||
|
||||
VisualElement listElement = new();
|
||||
Refresh();
|
||||
Button button = new(() =>
|
||||
{
|
||||
sensor.Excute();
|
||||
Refresh();
|
||||
});
|
||||
button.text = "Test";
|
||||
|
||||
container.Add(listElement);
|
||||
container.Add(button);
|
||||
return container;
|
||||
|
||||
void Refresh()
|
||||
{
|
||||
listElement.Clear();
|
||||
listElement.Add(new Label("Detected:"));
|
||||
sensor.detecteds.ForEach(x =>
|
||||
{
|
||||
var objectFiled = new ObjectField();
|
||||
objectFiled.objectType = typeof(Transform);
|
||||
objectFiled.value = x;
|
||||
listElement.Add(objectFiled);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
} */
|
||||
}
|
Reference in New Issue
Block a user