fix: Update UINPC when spawn.
This commit is contained in:
@@ -133,8 +133,8 @@ public class CECNPC : CECObject
|
||||
BMLogger.LogError("HoangDev npcVisual");
|
||||
}
|
||||
m_pNPCModelPolicy.SetNpcVisual(npcVisual);
|
||||
m_npcUI = GetComponentInChildren<UINPC>();
|
||||
|
||||
m_npcUI = GetComponentInChildren<UINPC>(true);
|
||||
m_npcUI.gameObject.SetActive(true);
|
||||
|
||||
// 2) Cắt “đuôi” ngay sau phần cố định info_npc
|
||||
int fixedSize = System.Runtime.InteropServices.Marshal.SizeOf<info_npc>();
|
||||
@@ -1170,7 +1170,10 @@ public class CECNPC : CECObject
|
||||
|
||||
// UINPC.Start can run before async model instantiate; refresh anchor once SMR hierarchy exists.
|
||||
// UINPC.Start可能在异步模型实例化之前执行;SMR层次就绪后刷新名牌锚点。
|
||||
m_npcUI?.RefreshWorldNameplatePosition();
|
||||
if(m_npcUI != null && m_npcUI.gameObject.activeInHierarchy)
|
||||
{
|
||||
m_npcUI?.RefreshWorldNameplatePosition();
|
||||
}
|
||||
|
||||
//QueueECModelForLoad(MTL_ECM_NPC, GetNPCInfo().nid, GetBornStamp(), GetServerPos(), szModelFile, tid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user