Last active
August 29, 2015 14:13
-
-
Save BrentFarris/344d3cf15bfe5eeba24f to your computer and use it in GitHub Desktop.
Forge Networking: Buffered Network Instantiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using BeardedManStudios.Network; | |
public class MakePlayer : MonoBehaviour | |
{ | |
private void Start() | |
{ | |
if (Networking.PrimarySocket.Connected) | |
Networking.Instantiate("Guy", NetworkReceivers.AllBuffered); | |
else | |
{ | |
Networking.PrimarySocket.connected += delegate() | |
{ | |
Networking.Instantiate("Guy", NetworkReceivers.AllBuffered); | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment