Beispiel #1
0
        public void EquipExistingWeapon(WeaponItemRuntime weapon)
        {
            weapon.transform.SetParent(rightHandTrans);
            weapon.transform.localPosition = Vector3.zero;
            weapon.transform.localRotation = Quaternion.identity;

            currentWeaponRuntime    = weapon;
            currentInHandWeaponData = weapon.weaponItemData;
            weapon.PickupWeaponPlayer();
            weapon.DisableCollisionColliders();

            animController.SetAnimInt(animController.animData.weaponAnimID, currentWeaponRuntime.weaponItemData.weaponAnimID);
            animController.PlayAnimationHash(animController.animData.getNewWeaponAnimationClass);

            switch (currentInHandWeaponData.weaponType)
            {
            case WeaponType.RANGED:
                EquipRangedWeapon();
                break;

            case WeaponType.MELEE:
                EquipMeleeWeapon();
                break;
            }
        }
Beispiel #2
0
        void EquipWeaponOnGameStart()
        {
            currentWeaponRuntime.aiInventoryController = this;
            currentWeaponRuntime.FreshSpawnWeapon();
            currentWeaponRuntime.Init();
            currentWeaponRuntime.DisableCollisionColliders();

            animController.SetAnimInt(animController.animData.weaponAnimID, currentWeaponRuntime.weaponItemData.weaponAnimID);
            animController.PlayAnimationHash(animController.animData.getNewWeaponAnimationClass);

            switch (currentInHandWeaponData.weaponType)
            {
            case WeaponType.RANGED:
                EquipRangedWeapon();
                break;

            case WeaponType.MELEE:
                EquipMeleeWeapon();
                break;
            }
        }