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); }
void AttachWeapon(WeaponConfig weapon) { if (!weapon || !leftHand || !rightHand) { return; } currentWeaponPrefab = weapon.SpawnWeapon(leftHand, rightHand, GetComponent <Animator>()); }
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)); }