private void CreateClientWorker() { if (currentClientWorker != null) { Destroy(currentClientWorker); } currentClientWorker = Instantiate(clientWorkerPrefab); workerConnector = currentClientWorker.GetComponent <ClientWorkerConnector>(); connectionController = currentClientWorker.GetComponent <ConnectionController>(); connectionController.InformOfUI(canvasCameraObj, screenUIController); }
private void Update() { if (!connectButton.isActiveAndEnabled) { return; } clientWorkerConnector = clientWorkerConnector ?? ClientWorkerHandler.ClientWorkerConnector; if (clientWorkerConnector != null && clientWorkerConnector.Worker != null) { // Worker successfully connected if (connectButton.GetCurrentAnimatorStateInfo(0).IsName("ConnectingState")) { connectButton.SetTrigger("Ready"); } } }
private void Start() { clientWorkerConnector = gameObject.GetComponent <ClientWorkerConnector>(); connectButton = screenUIController.ConnectScreen.GetComponentInChildren <Animator>(); }