데이터 즉시 업데이트 로직 추가

This commit is contained in:
logonkhi
2025-08-13 18:35:11 +09:00
parent 29a08c22e5
commit 026d6554ae
12 changed files with 1670 additions and 2729 deletions

View File

@@ -154,6 +154,27 @@ namespace UVC.Factory.Component
}
}
private Renderer[]? objectRenderers;
/// <summary>
/// 객체와 모든 자식의 렌더링 상태를 제어합니다.
/// true이면 보이게, false이면 보이지 않게 설정합니다.
/// </summary>
public bool IsVisible
{
get => objectRenderers?.Length > 0 && objectRenderers[0] != null && objectRenderers[0].enabled;
set
{
if (objectRenderers != null)
{
foreach (var r in objectRenderers)
{
if (r != null) r.enabled = value;
}
}
}
}
protected virtual void Awake()
{
// 초기화 작업을 수행합니다.
@@ -167,12 +188,15 @@ namespace UVC.Factory.Component
modelObject.OnPointerEnterHandler += OnPointerEnter;
modelObject.OnPointerExitHandler += OnPointerExit;
}
// 자신과 모든 자식 객체에서 Renderer 컴포넌트를 찾아 캐시합니다.
objectRenderers = GetComponentsInChildren<Renderer>();
}
/// <summary>
/// FactoryObject를 FactoryObjectManager에 등록합니다.
/// </summary>
public void RegisterFactoryObject()
public virtual void RegisterFactoryObject()
{
if (Info != null) FactoryObjectManager.Instance.RegisterFactoryObject(this);
}
@@ -180,7 +204,7 @@ namespace UVC.Factory.Component
/// <summary>
/// FactoryObject를 FactoryObjectManager에서 등록 해제합니다.
/// </summary>
public void UnregisterFactoryObject()
public virtual void UnregisterFactoryObject()
{
if(Info != null) FactoryObjectManager.Instance.UnregisterFactoryObject(Info);
}
@@ -278,6 +302,12 @@ namespace UVC.Factory.Component
/// </summary>
public virtual void HideOutLine() { }
/// <summary>
/// 즉시 객체의 상태를 업데이트합니다.
/// </summary>
/// <param name="count">업데이트 횟수. 기본값은 1입니다.</param>
public virtual void UpdateImmediately(int count = 1) { }
/// <summary>
/// 객체의 위치를 가져옵니다. 월드 좌표 또는 로컬 좌표로 반환할 수 있습니다.
/// </summary>