Exemple #1
0
        public EWeaponSlotType UnArmWeapon(bool includeAction, Action callback)
        {
            if (IsHeldSlotEmpty)
            {
                return(EWeaponSlotType.None);
            }
            HeldWeaponAgent.StoreDynamic();
            var holdSlot = HeldSlotType;

            if (includeAction)
            {
                DoDrawUnarmWeaponWithAction(callback);
            }
            else
            {
                DoDrawUnarmWeaponWithoutAction(null, callback);
            }

            return(holdSlot);
        }
Exemple #2
0
        public void ArmWeapon(EWeaponSlotType slot, bool includeAction)
        {
            slot = processHelper.GetRealSlotType(slot);
            if (!processHelper.FilterSameSpecies(slot) || !processHelper.FilterSlotValied(slot))
            {
                return;
            }
            var nextAgent = GetWeaponAgent(slot);

            //把当前的一些枪械状态重置掉
            HeldWeaponAgent.StoreDynamic();
            var lastWeapon       = HeldWeaponAgent.ComponentScan;
            var destWeapon       = GetWeaponAgent(slot).ComponentScan;
            var appearanceStruct = processHelper.GetDrawAppearanceStruct(slot);

            DoSpecialAppearance();
            DoDrawInterrupt();
            if (includeAction)
            {
                if (IsHeldSlotEmpty)
                {
                    DoDrawArmWeaponWithActionFromEmpty(destWeapon, lastWeapon.ConfigId,
                                                       appearanceStruct);
                }
                else
                {
                    DoDrawArmWeaponWithActionFromOtherWeapon(destWeapon, lastWeapon.ConfigId,
                                                             appearanceStruct);
                }
            }
            else
            {
                //CharacterState控制动作相关
                DoDrawArmWeaponWithoutAction(destWeapon, lastWeapon.ConfigId,
                                             processHelper.GetDrawAppearanceStruct(slot));
            }

            onWeaponSwitchEvt(this, HeldConfigId, EInOrOff.In);
        }