using System; using System.Collections.Generic; using System.Text; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Serialization.Formatters; namespace GameEditorUnity3D { public class IpcRemoteObject : MarshalByRefObject { public delegate string RemoteCallBack(string s); public RemoteCallBack ServerCallback; private List ClientMsgs = new List(); public string SendToServer(string s) { if (ServerCallback != null) return ServerCallback(s); else return null; } public void SendToClient(string s) { ClientMsgs.Add(s); } public List RecvClientMsgs() { List msg = new List(ClientMsgs); ClientMsgs.Clear(); return msg; } public override object InitializeLifetimeService() { return null; } } }