Exemplo n.º 1
0
        void OnUseClick(object obj)
        {
            SoundManager.Instance.PlaySoundEffect("Sound_Button_Title_Click");
            if (m_CurTitleID == PlayerManager.Instance.FindHeroDataModel().PlayerValues.PlayerCommonValue.PLAYER_FIELD_VISIBLE_TITLE)
            {
                //卸下
                SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();
                var itemFlelInfo = ContainerInfomanager.Instance.itemFielArrayInfo.FirstOrDefault(p => p.LocalItemData._goodID == m_CurTitleID);
                dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = itemFlelInfo.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
                dataStruct.byPlace        = (byte)itemFlelInfo.sSyncContainerGoods_SC.nPlace;
                dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
                //dataStruct.desPlace = (targetContainerBoxSlot.MyContainerBoxSlotData.CurrentPlace - 1);
                dataStruct.byUseType = 1;
                NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
            }
            else
            {
                //穿上
                SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();
                var itemFlelInfo = ContainerInfomanager.Instance.itemFielArrayInfo.FirstOrDefault(p => p.LocalItemData._goodID == m_CurTitleID);

                dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = itemFlelInfo.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
                dataStruct.byPlace        = (byte)itemFlelInfo.sSyncContainerGoods_SC.nPlace;
                dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
                NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
            }
        }
Exemplo n.º 2
0
        protected void UseItems(object obj)//使用物品
        {
            EquipButtonType equipButtonType = GetEquipItemButtonStatus();

            switch (equipButtonType)
            {
            case EquipButtonType.CanEquip:
                Close();
                SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();
                dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = itemFielInfo.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
                dataStruct.byPlace        = (byte)itemFielInfo.sSyncContainerGoods_SC.nPlace;
                dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
                NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
                break;

            case EquipButtonType.ProfesionNotEnough:
                MessageBox.Instance.Show(3, "", LanguageTextManager.GetString("IDS_H2_48"), LanguageTextManager.GetString("IDS_H2_55"));
                //SetButtonGray(CancelButtonScript, LanguageTextManager.GetString("IDS_H2_48"));
                return;

            case EquipButtonType.LVNotEnough:
                MessageBox.Instance.Show(3, "", LanguageTextManager.GetString("IDS_H2_6"), LanguageTextManager.GetString("IDS_H2_55"));
                //SetButtonGray(CancelButtonScript, LanguageTextManager.GetString("IDS_H2_6"));
                return;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        void UseItem(UI.MainUI.ItemFielInfo itemFielInfo)//使用物品,目前暂定目标都为主角
        {
            SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = itemFielInfo.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)itemFielInfo.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
        }
Exemplo n.º 4
0
        void UseItem(UI.MainUI.ItemFielInfo itemFielInfo)//使用物品,目前暂定目标都为主角
        {
            SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = itemFielInfo.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)itemFielInfo.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
            //print("使用药品:" + dataStruct.dwContainerID1 + "," + LanguageTextManager.GetString(itemFielInfo.LocalItemData._szGoodsName));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 装备物品
        /// </summary>
        /// <param name="itemFielInfo"></param>
        public void SendEquiptItemToserver()
        {
            ItemFielInfo        equipmentItem = EquipmentItemFielInfo;
            SMsgContainerUse_CS dataStruct    = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = equipmentItem.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)equipmentItem.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
        }
Exemplo n.º 6
0
    /// <summary>
    /// 发送使用物品请求
    /// </summary>
    public void SendContainerUse(SMsgContainerUse_CS dataStruct)
    {
        if (dataStruct.byGoodsNum == 0)
        {
            dataStruct.byGoodsNum = 1;
        }

        Package pkg = dataStruct.GeneratePackage(MasterMsgType.NET_ROOT_CONTAINER, ContainerDefineManager.MSG_CONTAINER_USE);

        this.Request(pkg);
    }
Exemplo n.º 7
0
        /// <summary>
        /// 发送装备时装请求
        /// </summary>
        void EquipFashion()
        {
            SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = CurrentUnlockData.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)CurrentUnlockData.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            dataStruct.byUseType      = 0;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
            TraceUtil.Log("发送装备时装信息");
        }
Exemplo n.º 8
0
        /// <summary>
        /// 装备物品
        /// </summary>
        void EquiptItem()
        {
            SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = CurrentItem.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)CurrentItem.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            dataStruct.byUseType      = CurrentItem.LocalItemData._GoodsClass == 2 ? (byte)1 : (byte)0;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
            TraceUtil.Log(SystemModel.Jiang, "EquiptItem");
        }
Exemplo n.º 9
0
        /// <summary>
        /// 装备物品
        /// </summary>
        /// <param name="itemFielInfo"></param>
        public void EquiptItem(DragComponent dragComponent)
        {
            ContainerPackListManager.RemoveItemFromSlot(dragComponent);
            ItemFielInfo        equipmentItem = (dragComponent as SingleContainerBox).itemFielInfo;
            SMsgContainerUse_CS dataStruct    = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = equipmentItem.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)equipmentItem.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            dataStruct.byUseType      = equipmentItem.LocalItemData._GoodsClass == 2 ? (byte)1 : (byte)0;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
        }
Exemplo n.º 10
0
        public void SendUnloadEquipItemsToSever(ItemFielInfo itemFielInfo)
        {
            SMsgContainerUse_CS dataStruct = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = itemFielInfo.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)itemFielInfo.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            dataStruct.desPlace       = -1;
            dataStruct.byUseType      = itemFielInfo.LocalItemData._GoodsClass == 2 ? (byte)1 : (byte)0;
            TraceUtil.Log(string.Format("发送卸下装备到背包栏:目标位置:{0}", dataStruct.desPlace));
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 装备物品
        /// </summary>
        /// <param name="itemFielInfo"></param>
        public void SendEquiptItemToserver()
        {
            ItemFielInfo        equipmentItem = itemFielInfo;
            SMsgContainerUse_CS dataStruct    = new SMsgContainerUse_CS();

            dataStruct.dwContainerID1 = dataStruct.dwContainerID2 = equipmentItem.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID;
            dataStruct.byPlace        = (byte)equipmentItem.sSyncContainerGoods_SC.nPlace;
            dataStruct.uidTarget      = PlayerManager.Instance.FindHeroEntityModel().EntityDataStruct.SMsg_Header.uidEntity;
            NetServiceManager.Instance.ContainerService.SendContainerUse(dataStruct);
            //不等服务器,直接装上装备
            if (equipmentItem.LocalItemData._GoodsSubClass == 1)
            {
                string     weapon    = ItemDataManager.Instance.GetItemData(equipmentItem.LocalItemData._goodID)._ModelId;
                GameObject weaponObj = PlayerFactory.Instance.GetWeaponPrefab(weapon);
                var        weaponEff = (ItemDataManager.Instance.GetItemData(equipmentItem.LocalItemData._goodID) as EquipmentData).WeaponEff;
                RoleGenerate.ChangeWeapon(PlayerManager.Instance.FindHero(), weaponObj, weaponEff);
            }
            //		var heroPos = PlayerManager.Instance.FindHero().transform.position + new Vector3(CommonDefineManager.Instance.CommonDefine.HitNumber_VectorX, CommonDefineManager.Instance.CommonDefine.HitNumber_VectorY, CommonDefineManager.Instance.CommonDefine.HitNumber_VectorZ);
            //         PopupTextController.SettleResult(heroPos, "5555",   FightEffectType.BATTLE_EFFECT_EXPSHOW);
        }