- Home /
Question by
rapinnz · Jun 30, 2018 at 06:29 AM ·
networkingmultiplayernetworkinvoke
Player Networking
here's my script. for some reason the invokes have something wrong with them plz help
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Events;
using System;
[System.Serializable]
public class ToggleEvent : UnityEvent {}
public class PlayerNet : NetworkBehaviour
{
[SerializeField] ToggleEvent onToggleShared;
[SerializeField] ToggleEvent onToggleLocal;
[SerializeField] ToggleEvent onToggleRemote;
void Start()
{
EnablePlayer ();
}
void DisablePlayer()
{
onToggleShared.Invoke (false);
if (isLocalPlayer)
onToggleLocal.Invoke (false);
else
onToggleRemote.Invoke (false);
}
void EnablePlayer()
{
onToggleShared.Invoke (true);
if (isLocalPlayer)
onToggleLocal.Invoke (true);
else
onToggleRemote.Invoke (true);
}
}
Comment
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Can i make multiplayer game without unity multiplayer service ? 1 Answer
NetworkServer.dontListen not working - How do I stop clients connecting? 2 Answers
Multiplayer| Attaching camera to player (if i am the owner 1 Answer
How can I get "!networkView.isMine" to function properly? 1 Answer