private void OnSure(GameObject obj) { ConfProp confProp = m_bagData.prop.prop; if (m_bagData.infoType == PropInfoTypeEnum.Use) { if (confProp.type == 3) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.gift_open.ToString()); CSDropReq req = new CSDropReq(); req.PropId = confProp.id; req.Count = m_curNum; GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req); } else { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.item_use.ToString()); if (confProp.skillId <= 0) { PopUpManager.OpenNormalOnePop("skill not exits"); } GameSkillManager.Instance.OnStartSkill(confProp.id, m_curNum); } } else if (m_bagData.infoType == PropInfoTypeEnum.Sale) { EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.item_sold.ToString()); PlayerPropSellRequest req = new PlayerPropSellRequest(); PlayerPropMsg playerProp = new PlayerPropMsg(); playerProp.PropId = confProp.id; playerProp.Count = m_curNum; req.PlayerProps.Add(playerProp); GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req); System.Collections.Generic.Dictionary <UBSParamKeyName, object> _params = new System.Collections.Generic.Dictionary <UBSParamKeyName, object>() { { UBSParamKeyName.ContentID, confProp.id }, { UBSParamKeyName.ContentType, 1 }, { UBSParamKeyName.Description, UBSDescription.PROPSELL } }; UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.Pror_use, 1.0f, _params); } //GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(confProp.id); //EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_BAGUSE); }
public static void OpenGift(long propID, int num) { ConfProp confProp = ConfProp.Get(propID); if (confProp == null) { return; } if (confProp.type == 3 && confProp.bindType == 1) // { MessageHandler.RegisterMessageHandler(MessageDefine.SCDropResp, OnOpenGiftCallback); //MessageHandler.RegisterMessageHandler(MessageDefine.SCAutoOpenGiftDropResp, OnOpenGiftCallback); EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.gift_open.ToString()); CSDropReq req = new CSDropReq(); req.PropId = confProp.id; req.Count = num; GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req); } }