Network fixes 2
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
using FishNet.Object;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Player
|
||||
@ -46,7 +47,7 @@ namespace Player
|
||||
|
||||
timeSinceLastShot -= Time.deltaTime;
|
||||
}
|
||||
|
||||
[ServerRpc]
|
||||
public void ShotFired()
|
||||
{
|
||||
timeSinceLastShot = shootNoiseDuration;
|
||||
|
@ -198,14 +198,17 @@ public class PlayerInteractionHandler : NetworkBehaviour
|
||||
if (Input.GetButtonDown("Fire3")&&inputEnbaled)
|
||||
if (!IsCarrying)
|
||||
{
|
||||
if(!IsServer)
|
||||
SwitchWeaponMode();
|
||||
GunEnabled = !GunEnabled;
|
||||
if (!GunEnabled)
|
||||
pistol.Disable();
|
||||
pistol.gameObject.SetActive(GunEnabled);
|
||||
if (GunEnabled)
|
||||
pistol.Enable();
|
||||
|
||||
SwitchWeaponMode();
|
||||
if (!IsServer) {
|
||||
GunEnabled = !GunEnabled;
|
||||
if (!GunEnabled)
|
||||
pistol.Disable();
|
||||
pistol.gameObject.SetActive(GunEnabled);
|
||||
if (GunEnabled)
|
||||
pistol.Enable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (GunEnabled)
|
||||
|
Reference in New Issue
Block a user