Example #1
0
 public void OnBeforeSerialize()
 {
     if (remote != null)
     {
         m_RemotingState = remote.SaveState();
     }
 }
Example #2
0
        private void SetUpRemoting()
        {
            remote = new InputRemoting(manager);
            remote.RestoreState(m_RemotingState, manager);

            if (playerConnection != null)
            {
                DestroyImmediate(playerConnection);
            }

            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();
        }