public void Connect(string ip, int port) { ClientSocketMgr.GetIns().Connect(ip, port, () => { SetState(ClientStateEnum.Keyboard); }); }
void ProcessMouse(string name, object data) { string key = (string)data; Cmd4SendMouse cmd = new Cmd4SendMouse(); cmd.mouseData = key; ClientSocketMgr.GetIns().Send(cmd); }
void OnDestroy() { Ins = null; if (ClientSocketMgr.GetIns().BeConnect()) { ClientSocketMgr.GetIns().Close("scn destroy"); } }
void ProcessKBPress(string name, object data) { string key = (string)data; Debug.Log("KBPanel.ProcessKBPress->客户端按下:" + key); if (BeShiftOn) { BeShiftOn = false; CurPanel?.ProcessPressAbleKeyUI("shift", BeShiftOn); } if (BeAltOn) { BeAltOn = false; CurPanel?.ProcessPressAbleKeyUI("alt", BeAltOn); } if (BeCtrlOn) { BeCtrlOn = false; CurPanel?.ProcessPressAbleKeyUI("ctrl", BeCtrlOn); } if (ClientSocketMgr.GetIns().BeConnect()) { Debug.Log("PanelMgr.ProcessKBPress sendMsg key:" + key); Cmd4SendKB cmd = new Cmd4SendKB(); cmd.key = key; ClientSocketMgr.GetIns().Send(cmd); } else { Debug.LogError("sen msg when unconnect!!!"); } }