using UnityEngine;
using System.Collections;
public class GetGPS : MonoBehaviour {
public string gps_info = "";
public int flash_num = 1;
// Use this for initialization
void Start () {
}
void OnGUI () {
GUI.skin.label.fontSize = 28;
GUI.Label(new Rect(20,20,600,48),this.gps_info);
GUI.Label(new Rect(20,50,600,48),this.flash_num.ToString());
GUI.skin.button.fontSize = 50;
if (GUI.Button(new Rect(Screen.width/2-110,200,220,85),"GPS定位"))
{
// 这里需要启动一个协同程序
StartCoroutine(StartGPS());
}
if (GUI.Button(new Rect(Screen.width/2-110,400,220,85),"刷新GPS"))
{
this.gps_info = "N:" + Input.location.lastData.latitude + " E:"+Input.location.lastData.