private void OnDisable() { GameObject gcO = GameObject.FindWithTag("GameController"); if (gcO) { WebCamEmotionClient wcec = gcO.GetComponent <WebCamEmotionClient>(); if (wcec) { wcec.OnChange -= this.OnWebCam; } } }
private void OnEnable() { GameObject gcO = GameObject.FindWithTag("GameController"); if (gcO && !simulate) { WebCamEmotionClient wcec = gcO.GetComponent <WebCamEmotionClient>(); if (wcec) { wcec.OnChange += this.OnWebCam; } else { this.enabled = false; } } }