Skip to content

Commit 79e5f36

Browse files
authored
Merge pull request #63 from OpenCommissioning/development
Development
2 parents 5b5cfab + 313f091 commit 79e5f36

86 files changed

Lines changed: 2305 additions & 7135 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Editor/Scripts/Inspector/Axis.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace OC.Editor.Inspector
77
{
8-
[CustomEditor(typeof(Components.Axis), true), CanEditMultipleObjects]
8+
[CustomEditor(typeof(Components.Axis), false), CanEditMultipleObjects]
99
public class Axis : UnityEditor.Editor
1010
{
1111
public override VisualElement CreateInspectorGUI()
@@ -16,19 +16,11 @@ public override VisualElement CreateInspectorGUI()
1616
var container = new VisualElement();
1717

1818
var groupControl = new PropertyGroup("Control");
19-
var overrideToggle = new ToggleButton("Override").BindProperty(component.Override);
20-
var targetElement = new FloatField("Target") { isReadOnly = false }.BindProperty(component.Target).AlignedField();
21-
22-
groupControl.AddOptions(overrideToggle);
2319
groupControl.Add(new ObjectField("Actor"){bindingPath = "_actor", objectType = typeof(Components.Actor)}.AlignedField());
24-
groupControl.Add(targetElement);
20+
groupControl.Add(new FloatField("Target") { isReadOnly = false }.BindProperty(component.Target).AlignedField());
2521

2622
var groupStatus = new PropertyGroup("Status");
27-
var valueElement = new FloatField("Value") { isReadOnly = true }.BindProperty(component.Value).AlignedField();
28-
groupStatus.Add(valueElement);
29-
30-
component.Override.ValueChanged += targetElement.SetEnabled;
31-
targetElement.SetEnabled(component.Override.Value);
23+
groupStatus.Add(new FloatField("Value") { isReadOnly = true }.BindProperty(component.Value).AlignedField());
3224

3325
var groupSettings = new PropertyGroup("Settings");
3426
groupSettings.Add(new FloatField("Factor"){bindingPath = "_factor"}.AlignedField());

Editor/Scripts/Inspector/Button.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace OC.Editor.Inspector
99
{
10-
[CustomEditor(typeof(Interactions.Button), true), CanEditMultipleObjects]
10+
[CustomEditor(typeof(Interactions.Button), false), CanEditMultipleObjects]
1111
public class Button : UnityEditor.Editor
1212
{
1313
public override VisualElement CreateInspectorGUI()

Editor/Scripts/Inspector/Cylinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace OC.Editor.Inspector
77
{
8-
[CustomEditor(typeof(Components.Cylinder), true), CanEditMultipleObjects]
8+
[CustomEditor(typeof(Components.Cylinder), false), CanEditMultipleObjects]
99
public class Cylinder : UnityEditor.Editor
1010
{
1111
public override VisualElement CreateInspectorGUI()
@@ -16,7 +16,7 @@ public override VisualElement CreateInspectorGUI()
1616
var container = new VisualElement();
1717

1818
var groupControl = new PropertyGroup("Control");
19-
groupControl.AddOverrideOption(component);
19+
groupControl.AddLinkOverride(serializedObject);
2020
var hStack = new StackHorizontal();
2121
hStack.Add(new PushButton("Minus").BindProperty(component.Minus));
2222
hStack.Add(new PushButton("Plus").BindProperty(component.Plus));

Editor/Scripts/Inspector/DataReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace OC.Editor.Inspector
88
{
9-
[CustomEditor(typeof(Components.DataReader), true), CanEditMultipleObjects]
9+
[CustomEditor(typeof(Components.DataReader), false), CanEditMultipleObjects]
1010
public class DataReader : UnityEditor.Editor
1111
{
1212
public override VisualElement CreateInspectorGUI()

Editor/Scripts/Inspector/Door.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace OC.Editor.Inspector
88
{
9-
[CustomEditor(typeof(Interactions.Door), true), CanEditMultipleObjects]
9+
[CustomEditor(typeof(Interactions.Door), false), CanEditMultipleObjects]
1010
public class Door : UnityEditor.Editor
1111
{
1212
public override VisualElement CreateInspectorGUI()

Editor/Scripts/Inspector/DrivePosition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace OC.Editor.Inspector
88
{
9-
[CustomEditor(typeof(Components.DrivePosition), true), CanEditMultipleObjects]
9+
[CustomEditor(typeof(Components.DrivePosition), false), CanEditMultipleObjects]
1010
public class DrivePosition : UnityEditor.Editor
1111
{
1212
public override VisualElement CreateInspectorGUI()
@@ -17,9 +17,9 @@ public override VisualElement CreateInspectorGUI()
1717
var container = new VisualElement();
1818

1919
var groupControl = new PropertyGroup("Control");
20-
groupControl.AddOverrideOption(component);
20+
groupControl.AddLinkOverride(serializedObject);
2121
groupControl.Add(new FloatField("Target").BindProperty(component.Target).AlignedField());
22-
22+
2323
var groupStatus = new PropertyGroup("Status");
2424
groupStatus.Add(new LampField("Is Active", Color.green).BindProperty(component.IsActive).AlignedField());
2525
groupStatus.Add(new FloatField("Value"){isReadOnly = true}.BindProperty(component.Value).AlignedField());

Editor/Scripts/Inspector/DriveSimple.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace OC.Editor.Inspector
88
{
9-
[CustomEditor(typeof(Components.DriveSimple), true), CanEditMultipleObjects]
9+
[CustomEditor(typeof(Components.DriveSimple), false), CanEditMultipleObjects]
1010
public class DriveSimple : UnityEditor.Editor
1111
{
1212
public override VisualElement CreateInspectorGUI()
@@ -17,8 +17,7 @@ public override VisualElement CreateInspectorGUI()
1717
var container = new VisualElement();
1818

1919
var groupControl = new PropertyGroup("Control");
20-
groupControl.AddOverrideOption(component);
21-
groupControl.Add(new FloatField("Target").BindProperty(component.Target).AlignedField());
20+
groupControl.AddLinkOverride(serializedObject);
2221
var hStack = new StackHorizontal();
2322
hStack.Add(new ToggleButton("Backward").BindProperty(component.Backward));
2423
hStack.Add(new ToggleButton("Forward").BindProperty(component.Forward));

Editor/Scripts/Inspector/DriveSpeed.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace OC.Editor.Inspector
88
{
9-
[CustomEditor(typeof(Components.DriveSpeed), true), CanEditMultipleObjects]
9+
[CustomEditor(typeof(Components.DriveSpeed), false), CanEditMultipleObjects]
1010
public class DriveSpeed : UnityEditor.Editor
1111
{
1212
public override VisualElement CreateInspectorGUI()
@@ -17,7 +17,7 @@ public override VisualElement CreateInspectorGUI()
1717
var container = new VisualElement();
1818

1919
var groupControl = new PropertyGroup("Control");
20-
groupControl.AddOverrideOption(component);
20+
groupControl.AddLinkOverride(serializedObject);
2121
groupControl.Add(new FloatField("Target").BindProperty(component.Target).AlignedField());
2222

2323
var groupStatus = new PropertyGroup("Status");

Editor/Scripts/Inspector/Gripper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace OC.Editor.Inspector
88
{
9-
[CustomEditor(typeof(MaterialFlow.Gripper), true), CanEditMultipleObjects]
9+
[CustomEditor(typeof(MaterialFlow.Gripper), false), CanEditMultipleObjects]
1010
public class Gripper : UnityEditor.Editor
1111
{
1212
public override VisualElement CreateInspectorGUI()

Editor/Scripts/Inspector/Lamp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace OC.Editor.Inspector
99
{
10-
[CustomEditor(typeof(Interactions.Lamp), true), CanEditMultipleObjects]
10+
[CustomEditor(typeof(Interactions.Lamp), false), CanEditMultipleObjects]
1111
public class Lamp : UnityEditor.Editor
1212
{
1313
public override VisualElement CreateInspectorGUI()
@@ -18,7 +18,7 @@ public override VisualElement CreateInspectorGUI()
1818
var container = new VisualElement();
1919

2020
var groupControl = new PropertyGroup("Control");
21-
groupControl.AddOverrideOption(component);
21+
groupControl.AddLinkOverride(serializedObject);
2222
groupControl.Add(new ToggleButton("Signal").BindProperty(component.Value).AlignedField());
2323

2424
var groupStatus = new PropertyGroup("Status");

0 commit comments

Comments
 (0)