Update PlayerInteractionHandler.cs
This commit is contained in:
parent
990d992276
commit
db50852ac9
@ -76,6 +76,16 @@ public class PlayerInteractionHandler : NetworkBehaviour
|
||||
shift = GameObject.Find("CameraHidden").GetComponent<CameraShift>();
|
||||
|
||||
}
|
||||
[ServerRpc]
|
||||
public void SwitchWeaponMode()
|
||||
{
|
||||
GunEnabled = !GunEnabled;
|
||||
if (!GunEnabled)
|
||||
pistol.Disable();
|
||||
pistol.gameObject.SetActive(GunEnabled);
|
||||
if (GunEnabled)
|
||||
pistol.Enable();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
private void Update()
|
||||
@ -188,6 +198,7 @@ public class PlayerInteractionHandler : NetworkBehaviour
|
||||
if (Input.GetButtonDown("Fire3")&&inputEnbaled)
|
||||
if (!IsCarrying)
|
||||
{
|
||||
SwitchWeaponMode();
|
||||
GunEnabled = !GunEnabled;
|
||||
if (!GunEnabled)
|
||||
pistol.Disable();
|
||||
|
Reference in New Issue
Block a user