diff --git a/IRSequencer/.vs/IRSequencer/IRSequencer.scgdat b/IRSequencer/.vs/IRSequencer/IRSequencer.scgdat index 968322d..8f6a058 100644 Binary files a/IRSequencer/.vs/IRSequencer/IRSequencer.scgdat and b/IRSequencer/.vs/IRSequencer/IRSequencer.scgdat differ diff --git a/IRSequencer/IRSequencer/Gui/SequencerGUI.cs b/IRSequencer/IRSequencer/Gui/SequencerGUI.cs index 2abcf21..cb8f3f8 100644 --- a/IRSequencer/IRSequencer/Gui/SequencerGUI.cs +++ b/IRSequencer/IRSequencer/Gui/SequencerGUI.cs @@ -175,6 +175,29 @@ public void CheckForServoSelection() } } + public static Vector3 ClampWindowPosition(Vector3 windowPosition) + { + Canvas canvas = UIMasterController.Instance.appCanvas; + RectTransform canvasRectTransform = canvas.transform as RectTransform; + + var windowPositionOnScreen = RectTransformUtility.WorldToScreenPoint(UIMasterController.Instance.uiCamera, windowPosition); + + float clampedX = Mathf.Clamp(windowPositionOnScreen.x, 0, Screen.width); + float clampedY = Mathf.Clamp(windowPositionOnScreen.y, 0, Screen.height); + + windowPositionOnScreen = new Vector2(clampedX, clampedY); + + Vector3 newWindowPosition; + if (RectTransformUtility.ScreenPointToWorldPointInRectangle(canvasRectTransform, + windowPositionOnScreen, UIMasterController.Instance.uiCamera, out newWindowPosition)) + { + return newWindowPosition; + } + else + return Vector3.zero; + } + + public void Update() { if (firstUpdate) @@ -344,6 +367,9 @@ public void Update() sequenceStartToggle.isOn = sq.isActive; //sequenceStartToggle.onValueChanged.Invoke (sq.isActive); } + sequenceStartToggle.interactable = (sq.startState == module.currentState); + + sequenceUIControls.GetChild("SequenceStopButton").GetComponent