protected void GetEnviromentData() { string url = "https://free-api.heweather.com/s6/air/now?location=auto_ip&key=0ee001fdc5c7401d82d9f683a93fb881"; string ret = LigerRM.Common.WebRequestHelper.WebRequestPoster.Post(url); EnvObject r = JSONHelper.FromJson <EnvObject>(ret); ENV_DATA = r.HeWeather6[0].air_now_city.pm25 + "," + r.HeWeather6[0].air_now_city.pm10; }
void Start() { //Find Player_Movement script playerMovement = FindObjectOfType <Player_Movement>(); //find EnvObject script environment = FindObjectOfType <EnvObject>(); //Find sound manager sounds = GameObject.Find("SoundManager").GetComponent <SoundManager>(); //Find FallingPlatform fallingPlatform = FindObjectOfType <FallingPlatform>(); }
private void SaveMockData() { Debug.Log("Write database"); foreach (Transform platform in platformContainer.transform) { EnvObject temp = new EnvObject(platform.GetComponent <ObjectType> ().Type, platform.position, platform.rotation, platform.localScale); bluePrint.ListObject.Add(temp); } string path = "Assets/StreamingAssets/test.json"; string json = JsonUtility.ToJson(bluePrint); StreamWriter writer = new StreamWriter(path, true); writer.Write(json); writer.Close(); }
private void MakePlatform(EnvObject platForm) { GameObject temp = Instantiate(platformPrefab[platForm.type], platForm.location, platForm.rotation, platformContainer.transform) as GameObject; temp.transform.localScale = platForm.scale; }