Close ColorSelector on portchange

This commit is contained in:
Tim
2025-07-08 00:20:54 +02:00
parent f1dc79484a
commit 372ec517e8
2 changed files with 4 additions and 1 deletions

View File

@@ -26490,6 +26490,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
cms: {fileID: 89481405} cms: {fileID: 89481405}
marker: {fileID: 755573186} marker: {fileID: 755573186}
ColorSelector: {fileID: 1728979212}
--- !u!222 &1541654566 --- !u!222 &1541654566
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -8,6 +8,7 @@ public class PortSelectorButton : MonoBehaviour
public ChildModelSelector cms; public ChildModelSelector cms;
public GameObject marker; public GameObject marker;
public Action RemoveOtherMarkers; public Action RemoveOtherMarkers;
public ColorSelector ColorSelector;
public string PortID { get; set; } public string PortID { get; set; }
public int PortIndex { set; get; } public int PortIndex { set; get; }
@@ -17,7 +18,8 @@ public class PortSelectorButton : MonoBehaviour
} }
void OnClick() void OnClick()
{ {
Debug.Log($"Opening CMS on {this}"); Debug.Log($"Changing Port to {this}");
ColorSelector.ResetThis();
cms.PortID = PortID; cms.PortID = PortID;
cms.PortIndex = PortIndex; cms.PortIndex = PortIndex;
cms.AssignButtons(); // rebuilds GUI cms.AssignButtons(); // rebuilds GUI