Game Development Reference
In-Depth Information
if (maxWait < 1)
{
return;
}
if (iPhoneSettings.locationServiceStatus ==
LocationServiceStatus.Failed)
{
return;
}
else
{
locationFound = true;
}
iPhoneSettings.StopLocationServiceUpdates();
}
function OnGUI()
{
if(locationFound)
{
GUI.Label(Rect(10,10,200,30),"Latitude: " +
iPhoneInput.lastLocation.latitude);
GUI.Label(Rect(10,30,200,30),"Longitude: " +
iPhoneInput.lastLocation.longitude);
GUI.Label(Rect(10,50,200,30),"Altitude: " +
iPhoneInput.lastLocation.altitude);
GUI.Label(Rect(10,70,200,30),"Accuracy: " +
iPhoneInput.lastLocation.
horizontalAccuracy);
GUI.Label(Rect(10,90,200,30),"Time: " +
iPhoneInput.lastLocation.timestamp);
}
else
{
GUI.Label(Rect(10,10,200,30),
"Could not initialise location services.");
}
if(GUI.Button(Rect(10,110,80,50),"Quit"))
{
Application.Quit();
}
}
Step 3. Play. If your mobile device can access satellite data, the screen
will contain details of your GPS location.
Search Nedrilad ::




Custom Search