Network fixes 2
This commit is contained in:
parent
1030fd2fb9
commit
2bb8baa23c
@ -1,3 +1,4 @@
|
||||
using FishNet.Object;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@ -46,7 +47,9 @@ namespace Item
|
||||
isEnabled = true;
|
||||
}
|
||||
|
||||
|
||||
public abstract bool Interact();
|
||||
[ServerRpc]
|
||||
public abstract bool Interact(ref Inventory inventory, ref HeavyInteractableItem heavyInvent);
|
||||
|
||||
protected void BaseAwake()
|
||||
|
@ -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,8 +198,9 @@ public class PlayerInteractionHandler : NetworkBehaviour
|
||||
if (Input.GetButtonDown("Fire3")&&inputEnbaled)
|
||||
if (!IsCarrying)
|
||||
{
|
||||
if(!IsServer)
|
||||
|
||||
SwitchWeaponMode();
|
||||
if (!IsServer) {
|
||||
GunEnabled = !GunEnabled;
|
||||
if (!GunEnabled)
|
||||
pistol.Disable();
|
||||
@ -208,6 +209,8 @@ public class PlayerInteractionHandler : NetworkBehaviour
|
||||
pistol.Enable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (GunEnabled)
|
||||
{
|
||||
DisableFlashlight();
|
||||
|
Reference in New Issue
Block a user