// Use this for initialization void Start() { Debug.Log("UploaderScript: Start()"); if (timeStreamGo == null) timeStreamGo = GameObject.Find("TimeStream"); tss = timeStreamGo.GetComponent<TimeStreamScript>(); if (tss == null) Debug.Log("tts is null"); if (guiGo == null) guiGo = GameObject.Find("GUI"); if (guiGo != null) guiGo.SendMessage("AddToConsole", "^ Click to stop/start uploads ^", SendMessageOptions.DontRequireReceiver); // StartUploads(); }
// Use this for initialization void Start() { GameObject timestreamGo = GameObject.Find("TimeStream"); tss = timestreamGo.GetComponent<TimeStreamScript>(); counter = PlayerPrefs.GetInt("videoInterval"); audioCounter = PlayerPrefs.GetInt("audioInterval"); centerLabelStyle = new GUIStyle(skin.label); centerLabelStyle.alignment = TextAnchor.MiddleCenter; // Debug.Log(PlayerPrefs.GetString("captureVideo")); if (IsTrue(PlayerPrefs.GetString("captureVideo"))) { Debug.Log("captureVideo on"); webCamDevice = new WebCamDevice(); webcamTexture = new WebCamTexture(webCamDevice.name,1024,768,1); // renderer.material.mainTexture = webcamTexture; webcamTexture.Play(); cubeTexture = new Texture2D(webcamTexture.width, webcamTexture.height, TextureFormat.RGB24, false); photoCube.renderer.material.mainTexture = cubeTexture; videoCube.renderer.material.mainTexture = webcamTexture; Color[] cols = webcamTexture.GetPixels(); cubeTexture.SetPixels(cols); //(Texture2D)Instantiate(webcamTexture); cubeTexture.Apply(); StartCoroutine(DecrementCounter()); } if (IsTrue(PlayerPrefs.GetString("captureAudio"))) { Debug.Log("captureAudio on"); if (audioCounter > 0) { StartCoroutine(DecrementAudioCounter()); } else { StartCoroutine(DecrementAudioCounter2()); } } if (IsTrue(PlayerPrefs.GetString("captureAccel"))) { Debug.Log("captureAccel on"); StartCoroutine(AccelSampleCounter()); StartCoroutine(AccelStoreCounter()); } DateTime dt = DateTime.Now; // sessionInfo = SetupEventHandlerScript.session+"\n"+SetupEventHandlerScript.location+"\n"+dt.ToString(@"d/M/yyyy HH:mm"); //.ToString(); sessionInfo = PlayerPrefs.GetString("session")+"\n"+PlayerPrefs.GetString("location")+"\n"+dt.ToString(@"d/M/yyyy HH:mm"); //.ToString(); }
// Use this for initialization void Start() { // PlayerPrefs.DeleteAll(); Application.targetFrameRate = 20; if (timeStreamGo == null) timeStreamGo = GameObject.Find("TimeStream"); tss = timeStreamGo.GetComponent<TimeStreamScript>(); deviceStyle = new GUIStyle(skin.textField); deviceStyle.font = deviceFont; serverStyle = new GUIStyle(skin.label); serverStyle.font = deviceFont; centerLabelStyle = new GUIStyle(skin.label); centerLabelStyle.alignment = TextAnchor.MiddleCenter; // PlayerPrefs.DeleteAll(); // normally commented but can be used to remove the playerpref keys in the editor if (PlayerPrefs.HasKey("location")) { location = PlayerPrefs.GetString("location"); // locationLabel.text = location; } if (PlayerPrefs.HasKey("locationContextType")) { locationContextType = PlayerPrefs.GetString("locationContextType"); // locationLabel.text = location; } if (PlayerPrefs.HasKey("session")) { session = PlayerPrefs.GetString("session"); // sessionLabel.text = session; } if (PlayerPrefs.HasKey("sessionContextType")) { locationContextType = PlayerPrefs.GetString("sessionContextType"); // locationLabel.text = location; } if (PlayerPrefs.HasKey("username")) { username = PlayerPrefs.GetString("username"); // usernameLabel.text = username; } if (PlayerPrefs.HasKey("password")) { password = PlayerPrefs.GetString("password"); // passwordLabel.text = password; } if (PlayerPrefs.HasKey("device")) { device = PlayerPrefs.GetString("device"); // deviceLabel.text = device; } else { device = SystemInfo.deviceUniqueIdentifier; // deviceLabel.text = device; } if (PlayerPrefs.HasKey("project")) { project = PlayerPrefs.GetString("project"); // serverLabel.text = server; } if (PlayerPrefs.HasKey("server")) { server = PlayerPrefs.GetString("server"); // serverLabel.text = server; } }