void Awake() { RegisterEventHandler(); m_instance = this; if (ForgeRecipeDataBase != null) { foreach (var item in ForgeRecipeDataBase.ForgeRecipeDataList) { if (item.ForgeType == ForgingType.ForgEquipment) { m_ForgeRecipeData_Equip.Add(item); } else if (item.ForgeType == ForgingType.ForgGiftBox) { m_ForgeRecipeData_GiftBox.Add(item); } else if (item.ForgeType == ForgingType.ForgMaterial) { m_ForgeRecipeData_Material.Add(item); } } } else { TraceUtil.Log(SystemModel.wanglei, TraceLevel.Error, "铸造配方配置文件为空!"); } }
void OnDestroy() { m_instance = null; RemoveEventHandler(EventTypeEnum.PlayerLevelUpdate.ToString(), OnPlayerLvOrMoneyUpdate); UIEventManager.Instance.RemoveUIEventHandel(UIEventType.TownUIBtnLoadComplete, TownUISceneLoadComplete); UIEventManager.Instance.RemoveUIEventHandel(UIEventType.ResetContainerGoods, OnContainerChange); }