mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
31 lines
699 B
C#
31 lines
699 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using MLAPI;
|
|
using MLAPI.NetworkVariable;
|
|
using MLAPI.Transports;
|
|
using MLAPI.Messaging;
|
|
using TMPro;
|
|
|
|
public class PlayerNetworkingScript : NetworkBehaviour
|
|
{
|
|
public NetworkVariableInt dice = new NetworkVariableInt(new NetworkVariableSettings
|
|
{
|
|
WritePermission = NetworkVariablePermission.ServerOnly,
|
|
ReadPermission = NetworkVariablePermission.Everyone
|
|
});
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.J))
|
|
{
|
|
Debug.Log("J");
|
|
NetworkManager.Singleton.StopHost();
|
|
NetworkManager.Singleton.StartClient();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|