private void DoDrawArmWeaponWithActionFromEmpty(WeaponScanStruct destWeapon, int lastWeaponId,
                                                 WeaponDrawAppearanceStruct appearanceStruct)
 {
     WeaponToHand(destWeapon.ConfigId, lastWeaponId, appearanceStruct.targetSlot, appearanceStruct.armOnLeft);
     DoArmFinished(destWeapon, appearanceStruct.targetSlot);
     RelatedCharState.Select(RelatedAppearence.RemountP3WeaponOnRightHand, appearanceStruct.drawParam);
 }
 /// 没动作,直接刷新装备
 private void DoDrawArmWeaponWithoutAction(WeaponScanStruct destWeapon, int lastWeaponId,
                                           WeaponDrawAppearanceStruct appearanceStruct)
 {
     WeaponToHand(destWeapon.ConfigId, lastWeaponId, appearanceStruct.targetSlot, appearanceStruct.armOnLeft);
     OnDrawWeaponCallback(destWeapon, appearanceStruct.targetSlot);
     // DoArmFinished(destWeapon, appearanceStruct.targetSlot);
     //  RelatedAppearence.RemountP3WeaponOnRightHand();
 }
 /// 有动作,从旧装备上画新装备
 private void DoDrawArmWeaponWithActionFromOtherWeapon(WeaponScanStruct destWeapon, int lastWeaponId,
                                                       WeaponDrawAppearanceStruct appearanceStruct)
 {
     RelatedCharState.SwitchWeapon(() =>
     {
         WeaponToHand(destWeapon.ConfigId, lastWeaponId, appearanceStruct.targetSlot,
                      CompareUtility.IsApproximatelyEqual(appearanceStruct.drawParam,
                                                          AnimatorParametersHash.Instance.DrawLeftValue));
         onWeaponSwitchEvt(this, destWeapon.ConfigId, EInOrOff.Off);
     }, () => OnDrawWeaponCallback(destWeapon, appearanceStruct.targetSlot), appearanceStruct.switchParam);
 }
Exemplo n.º 4
0
 /// 有动作,从旧装备上画新装备
 private void DoDrawArmWeaponWithActionFromOtherWeapon(WeaponScanStruct destWeapon, int lastWeaponId,
                                                       WeaponDrawAppearanceStruct appearanceStruct)
 {
     RelatedCharState.SwitchWeapon(
         () =>
     {
         WeaponToHand(destWeapon.ConfigId, lastWeaponId, appearanceStruct.targetSlot,
                      appearanceStruct.armOnLeft);
         onWeaponSwitchEvt(this, destWeapon.ConfigId, EInOrOff.Off);
     },
         () => OnDrawWeaponCallback(destWeapon, appearanceStruct.targetSlot), appearanceStruct.switchParam);
 }
Exemplo n.º 5
0
        public WeaponDrawAppearanceStruct GetDrawAppearanceStruct(EWeaponSlotType slot)
        {
            var weaponDrawStruct = new WeaponDrawAppearanceStruct();
            var armOnLeft        = FilterHoldSecondWeapon();
            var drawOnLeft       = armOnLeft && (slot != EWeaponSlotType.PistolWeapon &&
                                                 slot != EWeaponSlotType.MeleeWeapon &&
                                                 slot != EWeaponSlotType.ThrowingWeapon);

            weaponDrawStruct.holsterParam = WeaponUtil.GetHolsterParam(armOnLeft);
            weaponDrawStruct.targetSlot   = slot;
            weaponDrawStruct.drawParam    = drawOnLeft
                ? AnimatorParametersHash.Instance.DrawLeftValue
                : AnimatorParametersHash.Instance.DrawRightValue;
            weaponDrawStruct.armOnLeft = armOnLeft;
            return(weaponDrawStruct);
        }