Advertisement
CaptainSpaceCat

TestClient

Jul 26th, 2022
1,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using UnityEngine;
  2. using System;
  3.  
  4. public class TestClient : MonoBehaviour {
  5.     private TestRequester _testRequester;
  6.     public event Action<bool> OnHandleResponse;
  7.  
  8.     private void Start() {
  9.         _testRequester = new TestRequester();
  10.         _testRequester.OnReceiveResponse += HandleResponse;
  11.         _testRequester.Start();
  12.     }
  13.  
  14.     private void OnDestroy() {
  15.         _testRequester.Stop();
  16.     }
  17.  
  18.     public void SendCalibrationPoint(Vector2 point) {
  19.         _testRequester.AddSendCommand(point.ToString());
  20.     }
  21.  
  22.     private void HandleResponse(bool result) {
  23.         OnHandleResponse(result);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement