예제 #1
0
        public void WeaponChanged(Weapon.WeaponEnum weaponEnum)
        {
            switch (weaponEnum)
            {
            case Weapon.WeaponEnum.Fists:
                GetComponent <Animator>().runtimeAnimatorController = _ogAnimator;
                InitializeAnimatorOverrideController();

                _thirdPersonCharacter.ChangeAnimator();
                _thirdPersonUserControl.ChangeAnimator();
                break;

            case Weapon.WeaponEnum.Gloves:
                GetComponent <Animator>().runtimeAnimatorController = _ogAnimator;
                InitializeAnimatorOverrideController();

                _thirdPersonCharacter.ChangeAnimator();
                _thirdPersonUserControl.ChangeAnimator();
                break;

            case Weapon.WeaponEnum.Knife:
                GetComponent <Animator>().runtimeAnimatorController = _ogAnimator;

                InitializeAnimatorOverrideController();

                _thirdPersonCharacter.ChangeAnimator();
                _thirdPersonUserControl.ChangeAnimator();
                _clipOverrides["Uppercut"] = Clips.KnifeAttackAnimationClip;
                _clipOverrides["idleLoco"] = Clips.KnifeIdleAnimationClip;
                break;

            case Weapon.WeaponEnum.WarHammer:
                GetComponent <Animator>().runtimeAnimatorController = _animatorAxe;
                InitializeAnimatorOverrideController();
                _thirdPersonCharacter.ChangeAnimator();
                _thirdPersonUserControl.ChangeAnimator();
                break;

            case Weapon.WeaponEnum.Gun:
                GetComponent <Animator>().runtimeAnimatorController = _animatorGun;
                InitializeAnimatorOverrideController();
                _thirdPersonCharacter.ChangeAnimator();
                _thirdPersonUserControl.ChangeAnimator();

                break;

            default:
                throw new ArgumentOutOfRangeException("weaponEnum", weaponEnum, null);
            }
            _animatorOverrideController.ApplyOverrides(_clipOverrides);
        }