Update EC_ManMatter.cs

This commit is contained in:
HungDK
2025-12-22 17:55:10 +07:00
parent 9fcbdf7e5c
commit 1aaec5865d
@@ -46,6 +46,22 @@ namespace PerfectWorld.Scripts.Managers
// Storage for matter data that players can access later
private Dictionary<int, info_matter> matterDataStorage = new Dictionary<int, info_matter>();
private Dictionary<int, CECMatter> m_MatterTab = new Dictionary<int, CECMatter>();
/// <summary>
/// Unity-only recovery: ensure an existing scene matter is present in the manager table.
/// This helps recover after Unity script/domain reload where Dictionaries are not serialized.
/// </summary>
public void RegisterExistingMatter(CECMatter matter)
{
if (matter == null)
return;
int mid = matter.GetMatterID();
if (mid == 0)
return;
m_MatterTab[mid] = matter;
}
public bool ProcessMessage(ECMSG Msg)
{
if (Msg.iSubID == 0)