Ejemplo n.º 1
0
        private Weapon AttachWeapon(WeaponConfig weapon)
        {
            var currentWeapon = weapon.SpawnWeapon(rightHandTransfom, leftHandTransform, GetComponent <Animator>());

            onHit.AddListener(currentWeapon.OnHit);
            return(currentWeapon);
        }
        public Weapon EquipWeapon(WeaponConfig weaponConfig)
        {
            currentWeaponConfig = weaponConfig;
            Weapon weapon = weaponConfig.SpawnWeapon(animator, rightHandTransform, leftHandTransform);

            currentWeapon = weapon;
            return(weapon);
        }
Ejemplo n.º 3
0
        void AttachWeapon(WeaponConfig weapon)
        {
            if (!weapon || !leftHand || !rightHand)
            {
                return;
            }

            currentWeaponPrefab = weapon.SpawnWeapon(leftHand, rightHand, GetComponent <Animator>());
        }
Ejemplo n.º 4
0
 public Weapon AttachWeapon(WeaponConfig myWeapon)
 {
     // we always pass in the transforms of both hands
     // so that the Weapon script can use either or at its disposal
     return(myWeapon.SpawnWeapon(leftHand, rightHand, anim));
 }