public void autoLoad() { if (saveIP == null) { saveIP = gameObject.AddComponent <sc_SaveIPAddress>(); } if (!ComputerIP.Equals(saveIP.getLoadFIle())) { tempTextIP = saveIP.getLoadFIle(); ReConnect(); } }
// Use this for initialization void Start() { label_IPAdress = obj_label_IPAddress.GetComponent <Text>(); saveIP = GameObject.Find("EventSystem").AddComponent <sc_SaveIPAddress>(); saveIP.LoadFileIP(); label_IPAdress.text = saveIP.getData(); gogo = GameObject.Find("GogoAPI").GetComponent <GogoAPI>(); gogo.showDebug = true; lastUpdateTime = Time.time; canConnectedTime = Time.time; obj_panel_failed.SetActive(false); obj_panel_refillIPaddress.SetActive(false); }
private void Start() { if (saveIP == null) { saveIP = GameObject.Find("EventSystem").AddComponent <sc_SaveIPAddress>(); } defualtBakground = background.texture; WebCamDevice[] devices = WebCamTexture.devices; if (devices.Length == 0) { Debug.Log("No cameara detected"); camAvalible = false; return; } for (int i = 0; i < devices.Length; i++) { bool checkFrontCam = false; checkFrontCam = (Application.isEditor) ? devices[i].isFrontFacing : !devices[i].isFrontFacing; if (checkFrontCam) { backCam = new WebCamTexture(devices[i].name, Screen.width, Screen.height); } } if (backCam == null) { Debug.Log("Unable to find back Camemra"); return; } backCam.Play(); background.texture = backCam; camAvalible = true; }