// Use this for initialization void Start() { scoreLabel = GameObject.Find("Score Label").GetComponent <TextMesh> (); missLabel = GameObject.Find("Miss Label").GetComponent <TextMesh> (); control = GameObject.Find("Control Object").GetComponent <ControlStart>(); }
// Use this for initialization void Start() { ui = new UIMakerScript(); control = GameObject.Find("Control Object").GetComponent <ControlStart>(); dateTime = new GameObject("Date Label"); SetupBackgorund(); MakeGameNumber(); MakeScoreText(); MakeMissText(); MakeDateTime(); buttons.Add(MakePlayButton()); buttons.Add(MakeToggleButton()); buttons.Add(MakeShuffleButton()); buttons.Add(MakebackButton()); }
public void StartControl(string IP) { Task.Run(() => { try { OMGcontrolClient = new TcpClient(IP, 2112); } catch { return; } if (OMGcontrolClient.Connected) { ControlStart?.Invoke(); } OMGcontrolStream = OMGcontrolClient.GetStream(); try { var RO = ReadRootObject(OMGcontrolStream); Task.Run(() => SentInform?.Invoke(RO)); } catch { ControlEnd?.Invoke(); } try { using (ControlClient = new TcpClient(IP, 2113)) { using (NetworkStream stream = ControlClient.GetStream()) { RigInform RO; while (ControlClient.Connected) { RO = ReadRootObject(stream); Task.Run(() => SentInform?.Invoke(RO)); } ControlEnd?.Invoke(); } } } catch { ControlEnd?.Invoke(); } }); }