public void OnBeforeSerialize() { if (remote != null) { m_RemotingState = remote.SaveState(); } }
private void SetUpRemoting() { remote = new InputRemoting(manager); remote.RestoreState(m_RemotingState, manager); if (playerConnection == null) { playerConnection = CreateInstance <RemoteInputPlayerConnection>(); } remote.Subscribe(playerConnection); // Feed messages from players into editor. playerConnection.Subscribe(remote); // Feed messages from editor into players. playerConnection.Bind(EditorConnection.instance, false); // We don't enable sending on the editor's remote by default. // By default, the editor acts as a receiver only. m_RemotingState = new InputRemoting.SerializedState(); }