From 1aaec5865d7243d59d19ddf08b18399248cbc07d Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Mon, 22 Dec 2025 17:55:10 +0700 Subject: [PATCH] Update EC_ManMatter.cs --- .../Scripts/Managers/EC_ManMatter.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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)