private void SetWeaponInfo(WeaponScript weapon) { switch (conWeaponType) { case Weapontype.None: swingWeapon = null; shootingWeapon = null; throwingWeapon = null; break; case Weapontype.Swing: swingWeapon = (SwingWeaponScript)weapon; shootingWeapon = null; throwingWeapon = null; break; case Weapontype.Shooting: swingWeapon = null; shootingWeapon = (ShootingWeaponScript)weapon; throwingWeapon = null; break; case Weapontype.Throwing: swingWeapon = null; shootingWeapon = null; throwingWeapon = (ThrowingWeaponScript)weapon; break; } }
private void Throwing() { throwingWeapon.transform.SetParent(cantUseWeaponParent); // 집중상태에서는 클릭한 좌표로 던진다. if (isFocusMode) { isFocusMode = false; float magnitude = Vector3.Distance(crossHair.CrossHairWorldPosition(), transform.position); throwingWeapon.Throw(transform.forward, magnitude * 39.5f); } // 집중상태가 아닌 경우 적당한 힘으로 전방에 던진다. else { throwingWeapon.Throw(transform.forward, 200); } // slot을 비운다. weaponSlotManager.ResetWeapon(); // 현재 무기 정보 초기화 conWeaponType = Weapontype.None; throwingWeapon = null; }