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