diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs b/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs index b19e5aea37..5a95295b3f 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs @@ -46,6 +46,22 @@ namespace PerfectWorld.Scripts.Managers // Storage for matter data that players can access later private Dictionary matterDataStorage = new Dictionary(); private Dictionary m_MatterTab = new Dictionary(); + + /// + /// 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. + /// + 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)