간섭 되고 있는 객체 목록 UI/간섭 위치로 이동 #26
@@ -749,8 +749,8 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Content: {fileID: 4882471393303392760}
|
||||
m_Horizontal: 1
|
||||
m_Vertical: 1
|
||||
m_Horizontal: 0
|
||||
m_Vertical: 0
|
||||
m_MovementType: 1
|
||||
m_Elasticity: 0.1
|
||||
m_Inertia: 1
|
||||
|
||||
@@ -129,7 +129,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3370172682590216116}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
@@ -255,7 +255,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
@@ -484,7 +484,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
@@ -615,7 +615,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8937521091615675097}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
|
||||
@@ -8014,7 +8014,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7269315550475766926, guid: 3335bcff08be47a4baa17f7fde07b24e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0.0000040841874
|
||||
value: 0.0000045731117
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7484356029459005624, guid: 3335bcff08be47a4baa17f7fde07b24e, type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -8146,6 +8146,7 @@ Transform:
|
||||
- {fileID: 1149817090}
|
||||
- {fileID: 636283413}
|
||||
- {fileID: 1437072834}
|
||||
- {fileID: 1451571416}
|
||||
- {fileID: 1552320077}
|
||||
- {fileID: 2021424132}
|
||||
- {fileID: 1123988285}
|
||||
@@ -14141,6 +14142,52 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1441967167}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1451571415
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1451571416}
|
||||
- component: {fileID: 1451571417}
|
||||
m_Layer: 0
|
||||
m_Name: CameraManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1451571416
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1451571415}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1093055756}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1451571417
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1451571415}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d2be0153517c66d468b831d2f067af0f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
objectViewDistance: 25
|
||||
objectViewRotation: {x: 45, y: 145, z: 0}
|
||||
--- !u!224 &1452621084 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 6291666171046911034, guid: 1bc9e043f1497cd4fbb8e241c26966c1, type: 3}
|
||||
|
||||
@@ -115,8 +115,8 @@ namespace XED.Asset
|
||||
TwinObject selectedTwinObject = selectedItem.GetComponent<TwinObject>();
|
||||
if (selectedTwinObject != null)
|
||||
{
|
||||
selectedTwinObject.onTwinConflictEvent += panel_InterferedObjectList.CreateContentButton;
|
||||
selectedTwinObject.onTwinDeconflictEvent += panel_InterferedObjectList.RemoveContentButton;
|
||||
selectedTwinObject.OnTwinConflictEvent += panel_InterferedObjectList.CreateContentButton;
|
||||
selectedTwinObject.OnTwinDeconflictEvent += panel_InterferedObjectList.RemoveContentButton;
|
||||
}
|
||||
}
|
||||
public void OnAssetDropped(HierarchyItem item)
|
||||
|
||||
21
Assets/Scripts/Studio/Managers/CameraManager.cs
Normal file
21
Assets/Scripts/Studio/Managers/CameraManager.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using XRLib;
|
||||
|
||||
namespace XED
|
||||
{
|
||||
public class CameraManager : MonoBehaviour, ISingle
|
||||
{
|
||||
[SerializeField]
|
||||
float objectViewDistance = 25f;
|
||||
[SerializeField]
|
||||
Vector3 objectViewRotation = new Vector3(45, 145, 0);
|
||||
|
||||
public void MoveToTwinObjectPos(TwinObject twinObject)
|
||||
{
|
||||
Camera.main.transform.rotation = Quaternion.Euler(objectViewRotation);
|
||||
|
||||
Camera.main.transform.position = twinObject.transform.position;
|
||||
Camera.main.transform.position += -Camera.main.transform.forward * objectViewDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Studio/Managers/CameraManager.cs.meta
Normal file
2
Assets/Scripts/Studio/Managers/CameraManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2be0153517c66d468b831d2f067af0f
|
||||
@@ -20,8 +20,8 @@ namespace XED
|
||||
[PropertyVisible, Tooltip("µÎ ¹øÂ° info")]
|
||||
public bool IsInteractible;
|
||||
|
||||
public event Action<TwinObject, TwinObject> onTwinConflictEvent;
|
||||
public event Action<TwinObject, TwinObject> onTwinDeconflictEvent;
|
||||
public event Action<TwinObject, TwinObject> OnTwinConflictEvent;
|
||||
public event Action<TwinObject, TwinObject> OnTwinDeconflictEvent;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
@@ -76,18 +76,18 @@ namespace XED
|
||||
|
||||
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()
|
||||
{
|
||||
onTwinConflictEvent = null;
|
||||
onTwinDeconflictEvent = null;
|
||||
OnTwinConflictEvent = null;
|
||||
OnTwinDeconflictEvent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -12,10 +13,34 @@ namespace XED.UI
|
||||
[SerializeField]
|
||||
Button Button_Object2;
|
||||
|
||||
public void Initialize(string name1, string name2)
|
||||
TwinObject interferedTwinObject1;
|
||||
TwinObject interferedTwinObject2;
|
||||
|
||||
public event Action<TwinObject> OnClickButton;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Button_Object1.GetComponentInChildren<TextMeshProUGUI>().text = name1;
|
||||
Button_Object2.GetComponentInChildren<TextMeshProUGUI>().text = name2;
|
||||
Button_Object1.onClick.AddListener(() => OnButtonClick(interferedTwinObject1));
|
||||
Button_Object2.onClick.AddListener(() => OnButtonClick(interferedTwinObject2));
|
||||
|
||||
OnClickButton += FindSingle<CameraManager>().MoveToTwinObjectPos;
|
||||
}
|
||||
|
||||
public void Initialize(TwinObject obj1, TwinObject obj2)
|
||||
{
|
||||
interferedTwinObject1 = obj1;
|
||||
interferedTwinObject2 = obj2;
|
||||
|
||||
string objectModelName1 = obj1.metaData.modeling.name;
|
||||
string objectModelName2 = obj2.metaData.modeling.name;
|
||||
|
||||
Button_Object1.GetComponentInChildren<TextMeshProUGUI>().text = objectModelName1;
|
||||
Button_Object2.GetComponentInChildren<TextMeshProUGUI>().text = objectModelName2;
|
||||
}
|
||||
|
||||
void OnButtonClick(TwinObject obj)
|
||||
{
|
||||
OnClickButton?.Invoke(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace XED.UI
|
||||
var newButton = Instantiate(buttonPrefab, content).GetComponent<UI_InterferedObjectButton>();
|
||||
createdPairs.Add(pair);
|
||||
createdButtons.Add(pair, newButton);
|
||||
newButton.Initialize(obj1.name, obj2.name);
|
||||
newButton.Initialize(obj1, obj2);
|
||||
}
|
||||
|
||||
public void RemoveContentButton(TwinObject obj1, TwinObject obj2)
|
||||
|
||||
Reference in New Issue
Block a user