From 57fa1f08b60eda7a119d8a4521f05fc19c2922b6 Mon Sep 17 00:00:00 2001 From: geondo55 <102933884+geondo55@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:34:30 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=88=EC=9A=B0=EC=8A=A4=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=82=B4=EB=A6=AC?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Studio/Managers/EventConnector.cs | 8 +- .../Studio/Managers/UserInputManager.cs | 77 +++++++++++-------- 2 files changed, 47 insertions(+), 38 deletions(-) diff --git a/Assets/Scripts/Studio/Managers/EventConnector.cs b/Assets/Scripts/Studio/Managers/EventConnector.cs index 30c75811..c7b5023e 100644 --- a/Assets/Scripts/Studio/Managers/EventConnector.cs +++ b/Assets/Scripts/Studio/Managers/EventConnector.cs @@ -58,10 +58,10 @@ namespace XED.Manage canvas_Popup.panel_objectinfo.onTransformChanged += renderObjectHandler.OnTransformChanged; canvas_DragArea.panel_draghandler.onDragBoxSelect += customAssetConnector.assetEventHandler.OnDragBoxSelect; - //statusPanel.AddController(renderObjectHandler); - //statusPanel.AddController(wallBuilder); - //statusPanel.AddModeEnterEvent(ModePanel.ProgramMode.AGVPathDrawing, canvas_Popup.agvnodemodepopup.Open); - //statusPanel.SetMode(ModePanel.ProgramMode.ObjectLayout); + statusPanel.AddController(renderObjectHandler); + statusPanel.AddController(wallBuilder); + statusPanel.AddModeEnterEvent(ModePanel.ProgramMode.AGVPathDrawing, canvas_Popup.agvnodemodepopup.Open); + statusPanel.SetMode(ModePanel.ProgramMode.ObjectLayout); var commandHandler = CommandInvoker.instance.GetInputHandler(); userInputManager.SetHandler(GetDefaultInputHandler()); userInputManager.SetHandler(commandHandler); diff --git a/Assets/Scripts/Studio/Managers/UserInputManager.cs b/Assets/Scripts/Studio/Managers/UserInputManager.cs index 34059167..e7998038 100644 --- a/Assets/Scripts/Studio/Managers/UserInputManager.cs +++ b/Assets/Scripts/Studio/Managers/UserInputManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using UnityEngine; using XRLib; @@ -103,55 +104,63 @@ namespace XED.Manage } updateLoop += handler.updateLoop; } - void Update() + IEnumerator UpdateCoroutine() { - - foreach (var key in downKeyActionTable.Keys) + while (true) { - if (Input.GetKeyDown(key)) + foreach (var key in downKeyActionTable.Keys) { - downKeyActionTable[key]?.Invoke(); - } - } - - foreach (var key in getKeyActionTable.Keys) - { - if (Input.GetKey(key)) - { - getKeyActionTable[key]?.Invoke(); - } - } - - foreach (var key in upKeyActionTable.Keys) - { - if (Input.GetKeyUp(key)) - { - upKeyActionTable[key]?.Invoke(); - } - } - - foreach (var key in shortCutActionTable.Keys) - { - if (Input.GetKey(key)) - { - if (shortCutActionTable.TryGetValue(key, out var kk)) + if (Input.GetKeyDown(key)) { - foreach (var k in kk) + Debug.Log("1"); + downKeyActionTable[key]?.Invoke(); + } + } + + foreach (var key in getKeyActionTable.Keys) + { + if (Input.GetKey(key)) + { + Debug.Log("2"); + getKeyActionTable[key]?.Invoke(); + } + } + + foreach (var key in upKeyActionTable.Keys) + { + if (Input.GetKeyUp(key)) + { + Debug.Log("3"); + upKeyActionTable[key]?.Invoke(); + } + } + + foreach (var key in shortCutActionTable.Keys) + { + if (Input.GetKey(key)) + { + Debug.Log("4"); + if (shortCutActionTable.TryGetValue(key, out var kk)) { - if (Input.GetKeyDown(k.Key)) + foreach (var k in kk) { - k.Value?.Invoke(); + if (Input.GetKeyDown(k.Key)) + { + k.Value?.Invoke(); + } } } } } - } - updateLoop?.Invoke(); + updateLoop?.Invoke(); + yield return null; + } } public override void Init() { + CoroutineRunner.instance.StartCoroutine(UpdateCoroutine()); } } }