오브젝트 복사 등 다른 생성으로는 이벤트 할당 안되는 버그 수정 #27
@@ -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<TwinObject, TwinObject> OnTwinConflictEvent;
|
||||
public Action<TwinObject, TwinObject> 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<Panel_InterferedObjectList>();
|
||||
}
|
||||
public void Binding(IEntity entity)
|
||||
{
|
||||
@@ -68,7 +70,7 @@ namespace XED
|
||||
if (!other.TryGetComponent<TwinObject>(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<TwinObject>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user