示例#1
0
 private void OnDisable()
 {
     PlayerConnectorAttribute.Disconnect(this);
     editorConnection.Unregister(EditorConnectionMessageID.Player, OnPlayerMessageReceived);
     editorConnection.DisconnectAll();
     editorConnection = null;
 }
示例#2
0
 private void OnEnable()
 {
     editorConnection = EditorConnection.instance;
     editorConnection.Initialize();
     editorConnection.RegisterConnection(OnPlayerConnected);
     editorConnection.RegisterDisconnection(OnPlayerDisconnected);
     editorConnection.Register(EditorConnectionMessageID.Player, OnPlayerMessageReceived);
     PlayerConnectorAttribute.Connect(this);
 }