From 0dda6a194681f087d09ea9dd4dd79b6078f54628 Mon Sep 17 00:00:00 2001 From: jmaniuvc Date: Tue, 25 Mar 2025 10:00:03 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=98=A4=EB=B8=8C=EC=A0=9D=ED=8A=B8=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=20=EB=93=B1=20=EB=8B=A4=EB=A5=B8=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EC=9C=BC=EB=A1=9C=EB=8A=94=20=EC=9D=B4=EB=B2=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=95=A0=EB=8B=B9=20=EC=95=88=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Studio/AssetTool/CustomAssetConnector.cs | 11 +---------- Assets/Scripts/Studio/TwinObject/TwinObject.cs | 13 +++++++++---- .../Studio/UI/Panel/Panel_InterferedObjectList.cs | 3 ++- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs b/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs index 799da301..60c76a91 100644 --- a/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs +++ b/Assets/Scripts/Studio/AssetTool/CustomAssetConnector.cs @@ -36,16 +36,13 @@ namespace XED.Asset public CustomAssetEventHandler assetEventHandler; public CustomAssetCommandHandler assetCommandHandler; - Panel_InterferedObjectList panel_InterferedObjectList; - void Awake() { saveLoadFBXData = FindFirstObjectByType(); renderObjectHandler = FindFirstObjectByType(); assetDataHandler = new CustomAssetDataHandler(this); assetEventHandler = new CustomAssetEventHandler(this); - assetCommandHandler = new CustomAssetCommandHandler(this); - panel_InterferedObjectList = FindAnyObjectByType(); + assetCommandHandler = new CustomAssetCommandHandler(this); } void Start() { @@ -112,12 +109,6 @@ namespace XED.Asset selectRenderObject.CreateRenderObject(); selectRenderObject.Select(); selectedAssetData.AddTransformToRender(selectedItem.transform); - TwinObject selectedTwinObject = selectedItem.GetComponent(); - if (selectedTwinObject != null) - { - selectedTwinObject.OnTwinConflictEvent += panel_InterferedObjectList.CreateContentButton; - selectedTwinObject.OnTwinDeconflictEvent += panel_InterferedObjectList.RemoveContentButton; - } } public void OnAssetDropped(HierarchyItem item) { diff --git a/Assets/Scripts/Studio/TwinObject/TwinObject.cs b/Assets/Scripts/Studio/TwinObject/TwinObject.cs index 3aebc774..b1ab512a 100644 --- a/Assets/Scripts/Studio/TwinObject/TwinObject.cs +++ b/Assets/Scripts/Studio/TwinObject/TwinObject.cs @@ -2,6 +2,7 @@ using System; using System.Diagnostics.Contracts; using UnityEngine; using XED.Attributes; +using XED.UI; using XED.VirtualFactory; namespace XED @@ -20,6 +21,8 @@ namespace XED [PropertyVisible, Tooltip("µÎ ¹øÂ° info")] public bool IsInteractible; + Panel_InterferedObjectList panel_InterferedObjectList; + public event Action OnTwinConflictEvent; public event Action OnTwinDeconflictEvent; @@ -29,6 +32,8 @@ namespace XED IsInteractible = true; physics.Init(this); metaData.Init(this); + + panel_InterferedObjectList = FindSingle(); } public void Binding(IEntity entity) { @@ -63,7 +68,7 @@ namespace XED if (!other.TryGetComponent(out TwinObject contracter)) return; - Conflict(contracter); + panel_InterferedObjectList.CreateContentButton(this, contracter); } private void OnTriggerExit(Collider other) @@ -71,17 +76,17 @@ namespace XED if (!other.TryGetComponent(out TwinObject contracter)) return; - Deconflict(contracter); + panel_InterferedObjectList.RemoveContentButton(this, contracter); } void Conflict(TwinObject contract) { - OnTwinConflictEvent.Invoke(this, contract); + OnTwinConflictEvent?.Invoke(this, contract); } void Deconflict(TwinObject contract) { - OnTwinDeconflictEvent.Invoke(this, contract); + OnTwinDeconflictEvent?.Invoke(this, contract); } private void OnDestroy() diff --git a/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs b/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs index c6697eac..22ae7f90 100644 --- a/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs +++ b/Assets/Scripts/Studio/UI/Panel/Panel_InterferedObjectList.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; +using XRLib; using XRLib.UI; namespace XED.UI { - public class Panel_InterferedObjectList : PanelBase + public class Panel_InterferedObjectList : PanelBase, ISingle { Button Button_Close; RectTransform content; -- 2.48.1.windows.1 From 199fdcf08f16db0ce2085a956188bf875bbc37f0 Mon Sep 17 00:00:00 2001 From: jmaniuvc Date: Tue, 25 Mar 2025 10:05:23 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Studio/TwinObject/TwinObject.cs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Assets/Scripts/Studio/TwinObject/TwinObject.cs b/Assets/Scripts/Studio/TwinObject/TwinObject.cs index b1ab512a..b148992e 100644 --- a/Assets/Scripts/Studio/TwinObject/TwinObject.cs +++ b/Assets/Scripts/Studio/TwinObject/TwinObject.cs @@ -23,9 +23,6 @@ namespace XED Panel_InterferedObjectList panel_InterferedObjectList; - public event Action OnTwinConflictEvent; - public event Action OnTwinDeconflictEvent; - public override void AfterAwake() { IsDisplayable = true; @@ -78,21 +75,5 @@ namespace XED panel_InterferedObjectList.RemoveContentButton(this, contracter); } - - void Conflict(TwinObject contract) - { - OnTwinConflictEvent?.Invoke(this, contract); - } - - void Deconflict(TwinObject contract) - { - OnTwinDeconflictEvent?.Invoke(this, contract); - } - - private void OnDestroy() - { - OnTwinConflictEvent = null; - OnTwinDeconflictEvent = null; - } } } \ No newline at end of file -- 2.48.1.windows.1 From e19c1d2d0713f49224dc71bf387858623afb6761 Mon Sep 17 00:00:00 2001 From: jmaniuvc Date: Tue, 25 Mar 2025 10:58:25 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=B6=A9=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Studio/TwinObject/TwinObject.cs | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Assets/Scripts/Studio/TwinObject/TwinObject.cs b/Assets/Scripts/Studio/TwinObject/TwinObject.cs index 05318ec3..8183be30 100644 --- a/Assets/Scripts/Studio/TwinObject/TwinObject.cs +++ b/Assets/Scripts/Studio/TwinObject/TwinObject.cs @@ -2,6 +2,7 @@ using Newtonsoft.Json; using System; using UnityEngine; using XED.Attributes; +using XED.UI; using XED.VirtualFactory; namespace XED @@ -20,8 +21,7 @@ namespace XED [PropertyVisible, Tooltip("µÎ ¹øÂ° info")] public bool IsInteractible; - public Action OnTwinConflictEvent; - public Action OnTwinDeconflictEvent; + Panel_InterferedObjectList panel_InterferedObjectList; public override void AfterAwake() { @@ -29,6 +29,8 @@ namespace XED IsInteractible = true; physics.Init(this); metaData.Init(this); + + panel_InterferedObjectList = FindSingle(); } public void Binding(IEntity entity) { @@ -68,7 +70,7 @@ namespace XED if (!other.TryGetComponent(out TwinObject contracter)) return; - Conflict(contracter); + panel_InterferedObjectList.CreateContentButton(this, contracter); } private void OnTriggerExit(Collider other) @@ -76,23 +78,8 @@ namespace XED if (!other.TryGetComponent(out TwinObject contracter)) return; - Deconflict(contracter); + panel_InterferedObjectList.RemoveContentButton(this, contracter); } - void Conflict(TwinObject contract) - { - OnTwinConflictEvent?.Invoke(this, contract); - } - - void Deconflict(TwinObject contract) - { - OnTwinDeconflictEvent?.Invoke(this, contract); - } - - private void OnDestroy() - { - OnTwinConflictEvent = null; - OnTwinDeconflictEvent = null; - } } } \ No newline at end of file -- 2.48.1.windows.1