From e4909c1658489eb8c9524f565cae8d0ee872bd9f Mon Sep 17 00:00:00 2001 From: NguyenVanDat Date: Tue, 10 Feb 2026 11:51:26 +0700 Subject: [PATCH 1/4] update logic clear chip --- .../PerfectWorld/Scripts/UI/CDlgMessageBox.cs | 4 +- .../Scripts/UI/Dialogs/DlgInstall.cs | 308 +++++++++--------- .../GamePlay/SkillUI/CDlgSkillSubListItem.cs | 12 +- Assets/Scripts/CECUIManager.cs | 36 +- 4 files changed, 185 insertions(+), 175 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/UI/CDlgMessageBox.cs b/Assets/PerfectWorld/Scripts/UI/CDlgMessageBox.cs index b75c1bb055..aea39d3f3a 100644 --- a/Assets/PerfectWorld/Scripts/UI/CDlgMessageBox.cs +++ b/Assets/PerfectWorld/Scripts/UI/CDlgMessageBox.cs @@ -57,8 +57,8 @@ namespace BrewMonster public void ShowMessageBox(MessageBoxData messageBoxData) { _messageData = messageBoxData; - SetName(messageBoxData.Title); - messageText.text = messageBoxData.Message; + SetName(string.IsNullOrEmpty(messageBoxData.Title) ? "" : messageBoxData.Title); + messageText.text = string.IsNullOrEmpty(messageBoxData.Message) ? "" : messageBoxData.Message; okButton.gameObject.SetActive(false); _noButton.gameObject.SetActive(false); diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs index ca4ec6b309..9d7f5d25b4 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs @@ -50,6 +50,9 @@ namespace BrewMonster private int m_FirstInvSlot = -1; private int m_SecondInvSlot = -1; private int m_install_price = -1; + + public InstallMode GetInstallMode => m_Mode; + public EC_IvtrItem SelectedEquip => m_SelectedEquip; public override void Awake() { @@ -264,10 +267,7 @@ namespace BrewMonster detailedItem.Freeze(true); - if(m_Mode == InstallMode.Disenchase) - { - CalculateUninstallPrice(detailedItem); - } + UpdateResourceInfo(); } private void OnDropMaterial(PointerEventData eventData) @@ -306,42 +306,8 @@ namespace BrewMonster SetSlotIcon(m_SlotSecondlParent, detailedItem); SetInventorySlotGray(btn, true); - - // GetGameUIMan().PlayItemSound(pIvtrSrc, true); - EC_IvtrStone pStone = null; - STONE_ESSENCE pEssence; - // ACHAR szText[40] = _AL("0"); - //check if material is stone and show price to merge - if(m_SelectedMaterial.GetClassID() == (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_STONE) - { - pStone = (EC_IvtrStone)m_SelectedMaterial; - pEssence = pStone.GetDBEssence(); - m_TxtMoney.text = $"{pEssence.install_price}"; - // a_sprintf(szText, _AL("%d"), pEssence->install_price); - // m_pTxtGold->SetText(szText); - } - // else if( 0 == stricmp(this->GetName(), "Win_Disenchase") - // && pIvtrSrc->IsEquipment() ) - // { - // a_LogOutput(1, "[Dat Embed] OnItemDragDrop stricmp(this->GetName(), Win_Disenchase"); - // int i, nAmount = 0, idItem; - // CECIvtrEquip *pEquip = (CECIvtrEquip *)pIvtrSrc; - // - // for( i = 0; i < pEquip->GetHoleNum(); i++ ) - // { - // idItem = pEquip->GetHoleItem(i); - // if( idItem <= 0 ) continue; - // - // pStone = (CECIvtrStone *)CECIvtrItem::CreateItem(idItem, 0, 1); - // pEssence = (STONE_ESSENCE *)pStone->GetDBEssence(); - // nAmount += pEssence->uninstall_price; - // delete pStone; - // } - // - // a_sprintf(szText, _AL("%d"), nAmount); - // m_pTxtGold->SetText(szText); - // } + UpdateResourceInfo(); } private void CalculateUninstallPrice(EC_IvtrItem equipment) @@ -447,121 +413,121 @@ namespace BrewMonster } private void OnClickedMergeOrReset() { - // PAUIDIALOG pMsgBox; CECHostPlayer pHost = GetHostPlayer(); - - if (pHost != null || m_Mode == InstallMode.Enchase) + string message = ""; + + int nMoney = m_install_price; + if( nMoney > pHost.GetMoneyAmount() ) { - // if( !m_pItema->GetDataPtr("ptr_CECIvtrItem") ) return; - string message = ""; - - int nMoney = m_install_price; - if (nMoney > pHost.GetMoneyAmount()) + message = GetGameUIMan().GetStringFromTable(226); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() { - message = GetGameUIMan().GetStringFromTable(226); - CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan().GetDialog("") - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox->SetLife(3); - return; - } - - EC_IvtrItem pIvtrA = m_SelectedEquip; - if (!pIvtrA.IsEquipment()) - { - message = GetGameUIMan().GetStringFromTable(223); - CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(223), MB_OK, - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox.SetLife(3); - return; - } - - EC_IvtrEquip pEquipA = (EC_IvtrEquip)pIvtrA; - // a_LogOutput(1, "[Dat Embed] Send protocol here"); - // if( 0 == string.CompareOrdinal(GetName(), "Win_Enchase") ) - // { - if (pEquipA.GetEmptyHoleNum() <= 0) - { - message = GetGameUIMan().GetStringFromTable(224); - CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan().MessageBox("", GetGameUIMan()->GetStringFromTable(224), MB_OK, - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox.SetLife(3); - return; - } - - EC_IvtrItem pIvtrB = m_SelectedMaterial; - if (pIvtrB == null || !pIvtrB.IsEmbeddable()) - { - message = GetGameUIMan().GetStringFromTable(225); - CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(225), MB_OK, - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox.SetLife(3); - return; - } - - if (pIvtrB.GetClassID() != (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_STONE) - return; - - int nStoneLevel = ((EC_IvtrStone)pIvtrB).GetDBEssence().level; - int nEquipLevel = -1; - switch (pEquipA.GetClassID()) - { - case (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_WEAPON: - nEquipLevel = ((CECIvtrWeapon)pEquipA).GetDBEssence().level; - break; - case (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_ARMOR: - nEquipLevel = ((EC_IvtrArmor)pEquipA).GetDBEssence().level; - break; - case (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_DECORATION: - nEquipLevel = ((EC_IvtrDecoration)pEquipA).GetDBEssence().level; - break; - } - - if (nStoneLevel > nEquipLevel) - { - message = GetGameUIMan().GetStringFromTable(300); - CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(300), MB_OK, - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox.SetLife(3); - return; - } - //pr - UnityGameSession.c2s_CmdNPCSevEmbed( - (ushort)m_SecondInvSlot, (ushort)m_FirstInvSlot, - pIvtrB.GetTemplateID(), pIvtrA.GetTemplateID()); - // ClearEquipment(); - // ClearStone(); - pHost.GetPack(InventoryConst.IVTRTYPE_PACK).UnfreezeAllItems(); - - message = GetGameUIMan().GetStringFromTable(228); - CECUIManager.Instance.ShowMessageBox("", message); - // GetGameUIMan().MessageBox("", GetGameUIMan().GetStringFromTable(228), - // MB_OK, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox.SetLife(3); - // } - // else if( 0 == stricmp(GetName(), "Win_Disenchase") ) - // { - // a_LogOutput(1, "[Dat Embed] Win_Disenchase"); - // if( pEquipA->GetEmptyHoleNum() == pEquipA->GetHoleNum() ) - // { - // GetGameUIMan()->MessageBox("", GetGameUIMan()->GetStringFromTable(227), MB_OK, - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox->SetLife(3); - // return; - // } - - // GetGameUIMan()->MessageBox("Game_Disenchase", GetGameUIMan()->GetStringFromTable(229), - // MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160)); - // } + Message = message, + Dlg = this + }); + return; } - else if (pHost != null || m_Mode == InstallMode.Disenchase) + EC_IvtrItem pIvtrA = m_SelectedEquip; + if( !pIvtrA.IsEquipment() ) { - // TODO: implement uninstall logicq + message = GetGameUIMan().GetStringFromTable(223); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() + { + Message = message, + Dlg = this + }); + return; + } + + EC_IvtrEquip pEquipA = (EC_IvtrEquip)pIvtrA; + if(m_Mode == InstallMode.Enchase) + { + if( pEquipA.GetEmptyHoleNum() <= 0 ) + { + message = GetGameUIMan().GetStringFromTable(224); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() + { + Message = message, + Dlg = this + }); + return; + } + + EC_IvtrItem pIvtrB = m_SelectedMaterial; + if(pIvtrB == null || !pIvtrB.IsEmbeddable() ) + { + message = GetGameUIMan().GetStringFromTable(225); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() + { + Message = message, + Dlg = this + }); + return; + } + + if( pIvtrB.GetClassID() != (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_STONE) + return; + + int nStoneLevel = ((EC_IvtrStone)pIvtrB).GetDBEssence().level; + int nEquipLevel = -1; + switch( pEquipA.GetClassID() ) + { + case (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_WEAPON: + nEquipLevel = ((CECIvtrWeapon)pEquipA).GetDBEssence().level; + break; + case (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_ARMOR: + nEquipLevel = ((EC_IvtrArmor)pEquipA).GetDBEssence().level; + break; + case (int)EC_IvtrEquip.EQUIP_CLASS_ID.ICID_DECORATION: + nEquipLevel = ((EC_IvtrDecoration)pEquipA).GetDBEssence().level; + break; + } + + if( nStoneLevel > nEquipLevel ) + { + message = GetGameUIMan().GetStringFromTable(300); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() + { + Message = message, + Dlg = this + }); + return; + } + //pr + UnityGameSession.c2s_CmdNPCSevEmbed( + (ushort)m_SecondInvSlot, (ushort)m_FirstInvSlot, + pIvtrB.GetTemplateID(), pIvtrA.GetTemplateID()); + pHost.GetPack(InventoryConst.IVTRTYPE_PACK).UnfreezeAllItems(); + + message = GetGameUIMan().GetStringFromTable(228); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() + { + Message = message, + Dlg = this + }); + } + else if(m_Mode == InstallMode.Disenchase) + { + if( pEquipA.GetEmptyHoleNum() == pEquipA.GetHoleNum()) + { + message = GetGameUIMan().GetStringFromTable(227); + CECUIManager.Instance.ShowMessageBox(new MessageBoxData() + { + Message = message, + Dlg = this + }); + return; + } + + message = GetGameUIMan().GetStringFromTable(229); + var x = new MessageBoxData() + { + Message = message, + Dlg = this, + MessageBoxType = MessageBoxType.BothYesNoButton + }; + CECUIManager.Instance.ShowMessageBox(x); } } @@ -604,5 +570,51 @@ namespace BrewMonster itemInventoryRoot.gameObject.SetActive(false); } } + private void UpdateResourceInfo() + { + // GetGameUIMan().PlayItemSound(pIvtrSrc, true); + EC_IvtrStone stone; + STONE_ESSENCE pEssence; + // ACHAR szText[40] = _AL("0"); + + //check if material is stone and show price to merge + if (m_Mode == InstallMode.Enchase) + { + if (m_SelectedMaterial != null) + { + stone = (EC_IvtrStone)m_SelectedMaterial; + pEssence = stone.GetDBEssence(); + m_TxtMoney.text = $"{pEssence.install_price}"; + // a_sprintf(szText, _AL("%d"), pEssence->install_price); + // m_pTxtGold->SetText(szText); + } + else + { + m_TxtMoney.text = $"{0}"; + } + + } + else if (m_Mode == InstallMode.Disenchase) + { + int i, nAmount = 0, idItem; + if (m_SelectedEquip is EC_IvtrEquip pEquip) + { + for( i = 0; i < pEquip.GetHoleNum(); i++ ) + { + idItem = pEquip.GetHoleItem(i); + if( idItem <= 0 ) continue; + + stone = (EC_IvtrStone)EC_IvtrItem.CreateItem(idItem, 0, 1); + pEssence = stone.GetDBEssence(); + nAmount += pEssence.uninstall_price; + } + m_TxtMoney.text = $"{nAmount}"; + } + else + { + m_TxtMoney.text = $"{0}"; + } + } + } } } \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/UI/GamePlay/SkillUI/CDlgSkillSubListItem.cs b/Assets/PerfectWorld/Scripts/UI/GamePlay/SkillUI/CDlgSkillSubListItem.cs index eedfb875d2..3b2b782b2b 100644 --- a/Assets/PerfectWorld/Scripts/UI/GamePlay/SkillUI/CDlgSkillSubListItem.cs +++ b/Assets/PerfectWorld/Scripts/UI/GamePlay/SkillUI/CDlgSkillSubListItem.cs @@ -54,7 +54,11 @@ namespace BrewMonster player.GetCurSkill() != null || player.IsFighting()) { - uiManager.ShowMessageBox("MessageBox", gameUIMan.GetStringFromTable(11327)); + uiManager.ShowMessageBox(new MessageBoxData() + { + Title = "MessageBox", + Message = gameUIMan.GetStringFromTable(11327) + }); } int nCondition = CECHostSkillModel.Instance.CheckLearnCondition(m_skillID); @@ -97,7 +101,11 @@ namespace BrewMonster int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1); string str = GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11326), needMoney, needSp); - var messagebox = uiManager.ShowMessageBox("Game_LearnSkill", str); + var messagebox = uiManager.ShowMessageBox(new MessageBoxData() + { + Title = "Game_LearnSkill", + Message = str, + }); messagebox.SetData((uint)m_skillID); //GetGameUIMan()->MessageBox("Game_LearnSkill", str, //GetGameUIMan()->GetStringFromTable(231), // MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); diff --git a/Assets/Scripts/CECUIManager.cs b/Assets/Scripts/CECUIManager.cs index d511547f9a..b4c3e49ca0 100644 --- a/Assets/Scripts/CECUIManager.cs +++ b/Assets/Scripts/CECUIManager.cs @@ -105,17 +105,12 @@ public class CECUIManager : MonoSingleton Debug.LogWarning($"Không tìm thấy UI {componentName} đã spawn trong canvasDlg. Type found: {(type != null ? type.FullName : "null")}"); } - public CDlgMessageBox ShowMessageBox(string title, string message) + public CDlgMessageBox ShowMessageBox(MessageBoxData messageBoxData) { var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox; if (msgBox != null) { - msgBox.ShowMessageBox(new MessageBoxData() - { - Title = title, - Message = message, - MessageBoxType = MessageBoxType.YesButton - }); + msgBox.ShowMessageBox(messageBoxData); return msgBox; } else @@ -236,24 +231,19 @@ public class CECUIManager : MonoSingleton } } - else if(string.CompareOrdinal("Game_Disenchase",pDlg.GetName())==0 && DialogBoxCommandIDs.IDOK == iRetVal) - { - // PAUIDIALOG pMsgBox; - var clearEmbeddedChipDlg = GetInGameUIMan().GetDialog("Game_Disenchase"); - // EC_IvtrItem pIvtr = (EC_IvtrItem)m_pDlgUninstall->m_pItema->GetDataPtr("ptr_CECIvtrItem"); - // - // pSession.c2s_CmdNPCSevClearEmbeddedChip( - // (WORD)m_pDlgUninstall->m_pItema->GetData(), pIvtr->GetTemplateID()); - // - // m_pDlgUninstall->Show(false); - // pHost->EndNPCService(); + else if (pDlg is DlgInstall dlgInstall && dlgInstall.GetInstallMode == DlgInstall.InstallMode.Disenchase && DialogBoxCommandIDs.IDOK == iRetVal) + { + UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip(dlgInstall.SelectedEquip.Slot, dlgInstall.SelectedEquip.GetTemplateID()); + + dlgInstall.Show(false); + pHost.EndNPCService(); // m_pCurNPCEssence = NULL; // m_pDlgInventory->Show(false); - // pHost->GetPack(IVTRTYPE_PACK)->UnfreezeAllItems(); - // - // MessageBox("", GetStringFromTable(228), MB_OK, - // A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox); - // pMsgBox->SetLife(3); + pHost.GetPack((int)InventoryType.IVTRTYPE_PACK).UnfreezeAllItems(); + ShowMessageBox(new MessageBoxData() + { + Message = pDlg.GetStringFromTable(228) + }); } } From a66bffd9d80d369e233b8479971abccfa658c815 Mon Sep 17 00:00:00 2001 From: NguyenVanDat Date: Wed, 11 Feb 2026 11:32:11 +0700 Subject: [PATCH 2/4] fix clear slot index --- Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs | 1 + Assets/Scripts/CECUIManager.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs index 9d7f5d25b4..77d29b63bf 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgInstall.cs @@ -53,6 +53,7 @@ namespace BrewMonster public InstallMode GetInstallMode => m_Mode; public EC_IvtrItem SelectedEquip => m_SelectedEquip; + public int FirstSlotIndex => m_FirstInvSlot; public override void Awake() { diff --git a/Assets/Scripts/CECUIManager.cs b/Assets/Scripts/CECUIManager.cs index aba8804edf..8ce0980e2c 100644 --- a/Assets/Scripts/CECUIManager.cs +++ b/Assets/Scripts/CECUIManager.cs @@ -256,7 +256,7 @@ public class CECUIManager : MonoSingleton } else if (pDlg is DlgInstall dlgInstall && dlgInstall.GetInstallMode == DlgInstall.InstallMode.Disenchase && DialogBoxCommandIDs.IDOK == iRetVal) { - UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip(dlgInstall.SelectedEquip.Slot, dlgInstall.SelectedEquip.GetTemplateID()); + UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip(dlgInstall.FirstSlotIndex, dlgInstall.SelectedEquip.GetTemplateID()); dlgInstall.Show(false); pHost.EndNPCService(); From 4226a0bf02ecef3cf6a5b27b1c04d88b04bccaf1 Mon Sep 17 00:00:00 2001 From: VuNgocHaiC7 Date: Mon, 23 Feb 2026 17:49:55 +0700 Subject: [PATCH 3/4] fix onDestroy ins addressableManager --- .../Scripts/Addressable/AddressableManager.cs | 2 +- Assets/PerfectWorld/Scripts/Common/AutoInitializer.cs | 1 + Assets/PerfectWorld/Scripts/Vfx/BaseVfxObject.cs | 8 ++++---- Assets/Scripts/CECGameRun.cs | 5 ----- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/Addressable/AddressableManager.cs b/Assets/PerfectWorld/Scripts/Addressable/AddressableManager.cs index e506ea9575..ada9d5e697 100644 --- a/Assets/PerfectWorld/Scripts/Addressable/AddressableManager.cs +++ b/Assets/PerfectWorld/Scripts/Addressable/AddressableManager.cs @@ -192,7 +192,7 @@ namespace BrewMonster.Scripts { if (handle.IsValid()) { - Addressables.Release(handle); + Addressables.Release(handle); } } diff --git a/Assets/PerfectWorld/Scripts/Common/AutoInitializer.cs b/Assets/PerfectWorld/Scripts/Common/AutoInitializer.cs index e6b44b7062..5cb1c9e198 100644 --- a/Assets/PerfectWorld/Scripts/Common/AutoInitializer.cs +++ b/Assets/PerfectWorld/Scripts/Common/AutoInitializer.cs @@ -20,6 +20,7 @@ namespace BrewMonster void OnDestroy() { + BMLogger.Log("AutoInitializer: OnDestroy called, disposing auto initializers"); foreach (var autoInitializer in _autoInitializers) { autoInitializer.Dispose(); diff --git a/Assets/PerfectWorld/Scripts/Vfx/BaseVfxObject.cs b/Assets/PerfectWorld/Scripts/Vfx/BaseVfxObject.cs index a2c7b5313a..242fc62397 100644 --- a/Assets/PerfectWorld/Scripts/Vfx/BaseVfxObject.cs +++ b/Assets/PerfectWorld/Scripts/Vfx/BaseVfxObject.cs @@ -42,10 +42,10 @@ namespace BrewMonster.PerfectWorld.Scripts.Vfx } private void OnDestroy() { - if(!string.IsNullOrEmpty(_vfxPath)) - { - AddressableManager.Instance.ReleaseAsset(_vfxPath); - } + //if(!string.IsNullOrEmpty(_vfxPath)) + //{ + // AddressableManager.Instance.ReleaseAsset(_vfxPath); + //} } private void Update() diff --git a/Assets/Scripts/CECGameRun.cs b/Assets/Scripts/CECGameRun.cs index 5c511f6dcb..5a1536e14c 100644 --- a/Assets/Scripts/CECGameRun.cs +++ b/Assets/Scripts/CECGameRun.cs @@ -107,11 +107,6 @@ public partial class CECGameRun private static void Dispose() { instance = null; - AddressableManager.Instance.ReleaseAsset(AddressResourceConfig.PlayerPrefab); - AddressableManager.Instance.ReleaseAsset(AddressResourceConfig.MonsterPrefab); - AddressableManager.Instance.ReleaseAsset(AddressResourceConfig.NpcServerPrefab); - //AddressableManager.Instance.ReleaseAsset(AddressResourceConfig.PetServerPrefab); - //AddressableManager.Instance.ReleaseAsset(AddressResourceConfig.PetMountServerPrefab); } private void LoadPrefabs() From 52450d789008887c7e77c2ec31ba40e08a037309 Mon Sep 17 00:00:00 2001 From: MinhHai Date: Tue, 24 Feb 2026 09:39:12 +0700 Subject: [PATCH 4/4] Fix bug Addressable singleton --- .../PerfectWorld/Scripts/World/LitModelHolder.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/World/LitModelHolder.cs b/Assets/PerfectWorld/Scripts/World/LitModelHolder.cs index 86745138d5..0127ad7edf 100644 --- a/Assets/PerfectWorld/Scripts/World/LitModelHolder.cs +++ b/Assets/PerfectWorld/Scripts/World/LitModelHolder.cs @@ -79,21 +79,6 @@ public class LitModelHolder : MonoSingleton _cts.Cancel(); _cts.Dispose(); } - - if (addressableObjects == null) - { - return; - } - - // go through candidate list and loaded list, unload all objects in those lists. - foreach (var kvp in _candidatesForLoading) - { - kvp.Key.UnloadAsset(); - } - foreach (var obj in _loadedObjects) - { - obj.UnloadAsset(); - } } #endregion