コード例 #1
0
 private void UpdateWeaponAnimation(IAdaptiveContainer <IFsmInputCommand> commandsContainer,
                                    PlayerEntity playerEntity)
 {
     try
     {
         SingletonManager.Get <DurationHelp>().ProfileStart(CustomProfilerStep.StateUpdateWeaponAnimation);
         // 更新武器动画
         _weaponAnim.FromAvatarAnimToWeaponAnimProgress(commandsContainer,
                                                        playerEntity.appearanceInterface.Appearance.GetWeaponP1InHand(),
                                                        playerEntity.appearanceInterface.Appearance.GetWeaponP3InHand(),
                                                        playerEntity.networkWeaponAnimation);
         _weaponAnim.FromWeaponAnimProgressToWeaponAnim(
             playerEntity.appearanceInterface.Appearance.GetWeaponP1InHand(),
             playerEntity.appearanceInterface.Appearance.GetWeaponP3InHand(),
             playerEntity.networkWeaponAnimation);
         // 武器动画结束
         _weaponAnim.WeaponAnimFinishedUpdate(commandsContainer,
                                              playerEntity.appearanceInterface.Appearance.GetWeaponP1InHand(),
                                              playerEntity.appearanceInterface.Appearance.GetWeaponP3InHand(),
                                              playerEntity.networkWeaponAnimation);
     }
     finally
     {
         SingletonManager.Get <DurationHelp>().ProfileEnd(CustomProfilerStep.StateUpdateWeaponAnimation);
     }
 }
コード例 #2
0
        protected override void OnPlayBack(PlayerEntity player)
        {
            if (!player.gamePlay.IsLifeState(EPlayerLifeState.Dead))
            {
                try
                {
                    _info.BeginProfileOnlyEnableProfile();

                    _weaponAnimation.FromWeaponAnimProgressToWeaponAnim(
                        null,
                        player.appearanceInterface.Appearance.GetWeaponP3InHand(),
                        player.networkWeaponAnimation);
                }
                finally
                {
                    _info.EndProfileOnlyEnableProfile();
                }
            }
        }