-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using LitJson; | ||
|
||
public class AirQuality : MonoBehaviour { | ||
|
||
public string token; | ||
public string stationId; | ||
public string property; | ||
|
||
// Use this for initialization | ||
IEnumerator Start () { | ||
Debug.Log("LoadData.Loading data"); | ||
WWW w = new WWW("http://api.waqi.info/feed/@" + stationId + "/?token=" + token); | ||
yield return w; | ||
|
||
JsonData json = JsonMapper.ToObject(w.text); | ||
string name = (string)json["data"]["city"]["name"]; | ||
Debug.Log("LoadData.name " + name); | ||
|
||
float value = float.Parse(json["data"]["iaqi"][property]["v"].ToString()); | ||
Vector3 scale = this.transform.localScale; | ||
scale.y *= value; | ||
this.transform.localScale = scale; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEditor; | ||
using System; | ||
|
||
[ExecuteInEditMode] | ||
public class DataLabel : MonoBehaviour { | ||
[TextArea] | ||
public string data; | ||
|
||
public float animationSpeed = 1.0f; | ||
|
||
private string[] values; | ||
private float valueIndex = 0; | ||
private string label = ""; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
try { | ||
this.values = this.data.Split(new Char[] {'\n'}); | ||
} catch (Exception e) { | ||
this.data = "" + e; | ||
} | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
if (values == null || values.Length == 0) return; | ||
|
||
int currIdx = (int)Mathf.Floor(this.valueIndex); | ||
|
||
currIdx %= this.values.Length; | ||
|
||
this.label = this.values[currIdx]; | ||
this.valueIndex += Time.deltaTime * animationSpeed; | ||
if (this.valueIndex > this.values.Length) { | ||
this.valueIndex -= this.values.Length; | ||
} | ||
} | ||
|
||
void OnSceneGUI () { | ||
Handles.BeginGUI(); | ||
|
||
//GUILayout.Window(2, new Rect(10, 0, 100, 100), (id)=> { | ||
// Content of window here | ||
GUILayout.Button("A Button"); | ||
//}, "Title"); | ||
|
||
Handles.EndGUI(); | ||
} | ||
|
||
void OnGUI () { | ||
GUI.color = Color.white; | ||
//GUI.backgroundColor = Color.white; | ||
GUI.Button (new Rect (25, 25, 100, 30), this.label); | ||
} | ||
|
||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Replicator : MonoBehaviour { | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sceneSetups: | ||
- path: Assets/Day02.unity | ||
- path: Assets/Day02_final.unity | ||
isLoaded: 1 | ||
isActive: 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,2 @@ | ||
Base path: /Applications/Unity/Unity.app/Contents | ||
Cmd: getPlatforms | ||
Cmd: compileSnippet | ||
api=15 type=0 insize=1020 outsize=832 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA ok=1 | ||
Cmd: compileSnippet | ||
api=15 type=1 insize=1020 outsize=0 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA ok=1 | ||
Cmd: compileSnippet | ||
api=15 type=0 insize=1907 outsize=2520 kw=SOFTPARTICLES_ON pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA ok=1 | ||
Cmd: compileSnippet | ||
api=15 type=1 insize=1907 outsize=0 kw=SOFTPARTICLES_ON pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA ok=1 | ||
Cmd: compileSnippet | ||
api=15 type=0 insize=1907 outsize=1265 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA ok=1 | ||
Cmd: compileSnippet | ||
api=15 type=1 insize=1907 outsize=0 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA ok=1 |