private void StartUpGPS() { GPSScript.StartGPS(); double[] gps = GPSScript.UpdateGPS(); Longitude = gps [0]; Latitude = gps [1]; }
void UpdateGPSData() { double[] gps = GPSScript.UpdateGPS(); GPSText.text = "Long: " + gps[0].ToString("####0.00000") + " Lat: " + gps[1].ToString("####0.00000"); double DistanceAway = POIChecker.DistanceAway(gps [0], gps [1], ClueLongitude, ClueLatitude); if (DistanceAway < 0.05) { Goal.GetComponent <Renderer> ().enabled = true; NextClue.GetComponent <Text>().enabled = true; DistanceText.text = "You are here!"; } else if (DistanceAway < 0.1) { Goal.GetComponent <Renderer> ().enabled = false; NextClue.GetComponent <Text>().enabled = false; DistanceText.text = "Getting closer, you are approximately " + DistanceAway.ToString("####0.000") + " Km away"; } else { Goal.GetComponent <Renderer>().enabled = false; NextClue.GetComponent <Text>().enabled = false; DistanceText.text = "You are approximately " + DistanceAway.ToString("####0.000") + " Km away"; } }
void Start() { Initialize(); SetClueText(); GPSScript.StartGPS(); UpdateClueImage(); }
// Start is called before the first frame update void Start() { canMove = true; mainCam = Camera.main; initialOrtoSize = mainCam.orthographicSize; gpsScript = FindObjectOfType <GPSScript>(); imgBounds = gpsScript.mapImage.GetComponent <Image>(); velocity = Vector3.zero; }
//private float compassSampleSum = 0; // Use this for initialization void Start() { catScr = myCatapult.GetComponent <CatapultScript> (); //transform.parent = GameObject.Find ("SceneCenter").transform; if (!isLocalPlayer) { //if (!isServer) { pillGuy = Instantiate(pillGuyObject); pillGuy.GetComponent <PillGuyMovement> ().myTablet = tablet.transform.gameObject; //} catScr.amLocal = false; Destroy(myCamObj); return; } makeGuiObj(); trackScript = GameObject.Find("SceneCenter").GetComponent <MultiTrackingScript> (); catScr.setLocalProperties(); camera = GameObject.Find("SceneCamera"); background = GameObject.Find("BackgroundPlane"); Vector3 storePos = background.transform.localPosition; Quaternion storeRot = background.transform.localRotation; background.transform.parent = myCamObj.transform; background.transform.localPosition = storePos; background.transform.localRotation = storeRot; myCam = myCamObj.GetComponent <Camera> (); camera.GetComponent <Camera> ().enabled = false; myCam.enabled = true; gps = GetComponent <GPSScript> (); //Spawn a catapult //myCatapult = Instantiate (catapult); //myCatapult.transform.parent = transform; //myCatapult.transform.localPosition = Vector3.zero; //myCatapult.transform.localRotation = Quaternion.identity; catScr.camera = myCam; string offGuiStr = GameObject.Find("OffsetGui").GetComponent <OffsetGuiScript>().offset; Destroy(GameObject.Find("OffsetGui")); string[] strs = offGuiStr.Split(new string[] { "," }, StringSplitOptions.None); if (strs.Length == 2) { OffsetProvided = true; offset = new Vector3(int.Parse(strs [0]), 0, int.Parse(strs [1])); } //compassStartTime = Time.time; }
// Use this for initialization void Start() { GameObject getGameObject = GameObject.Find("Camera"); GPSScript gpsScript = getGameObject.GetComponent <GPSScript>(); respawns = GameObject.FindGameObjectsWithTag("facultyInfo"); string _constr = Application.persistentDataPath + "/" + "skripsiDB.db"; // on Android //if (!File.Exists(_constr)) //{ // WWW getDB = new WWW("jar:file://" + Application.dataPath + "!/assets/" + "skripsiDB.db"); // while (!getDB.isDone) // { // } // File.WriteAllBytes(_constr, getDB.bytes); //} string conn = "URI=file:" + _constr; //WWW dbPath = new WWW(path); IDbConnection _dbc; _dbc = new SqliteConnection(conn); _dbc.Open(); IDbCommand _dbcm = _dbc.CreateCommand(); _dbcm.CommandText = "select * " + "FROM 'faculty' WHERE idInfo = " + gpsScript.idInfo; IDataReader _dbr = _dbcm.ExecuteReader(); while (_dbr.Read()) { respawns[0].GetComponent <TextMesh>().text = _dbr.GetString(2); respawns[1].GetComponent <TextMesh>().text = _dbr.GetString(3); } //_dbr.Close(); //_dbc.Close(); }
// Use this for initialization void Start() { gps = GetComponent <GPSScript> (); }