这是ios手机上的代码,没解读出来是什么意思?
using UnityEngine;using System.Collections.Generic;
public class CoreLocationGUIManager : MonoBehaviour
{
public GUIText text1;
public GUIText text2;
public GUIText text3;
public GUIText text4;
int modulous = 0;
void Start()
{
// kill the dang keyboard frame
iPhoneKeyboard.autorotateToPortrait = false;
iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
iPhoneKeyboard.autorotateToLandscapeRight = false;
iPhoneKeyboard.autorotateToLandscapeLeft = false;
// listen for location changes
CoreLocationManager.locationServicesDidUpdate += locationServicesDidUpdate;
}
public void locationServicesDidUpdate( CoreLocationData locationData )
{
Debug.Log( "locationServicesDidUpdate event: " + locationData );
text1.text = locationData.latitude.ToString();
text2.text = locationData.longitude.ToString();
}
void Update()
{
// only grab the compass data every 10 frames
if( modulous++ % 10 == 0 )
{
text3.text = CoreLocationBinding.getMagneticHeading().ToString();
text4.text = CoreLocationBinding.getTrueHeading().ToString();
}
}
void OnGUI()
{
float yPos = 10.0f;
float xPos = 20.0f;
float width = 160.0f;
if( GUI.Button( new Rect( xPos, yPos, width, 40 ), "Is Compass Avaialble?" ) )
{
bool compassAvailable = CoreLocationBinding.isCompassAvailable();
Debug.Log( "CoreMotion isCompassAvailable: " + compassAvailable );
}
if( GUI.Button( new Rect( xPos, yPos += 50, width, 40 ), "Set Distance Filter to 10" ) )
{
CoreLocationBinding.setDistanceFilter( 10 );
}
if( GUI.Button( new Rect( xPos, yPos += 50, width, 40 ), "Set Heading Filter to 3" ) )
{
CoreLocationBinding.setHeadingFilter( 3 );
}
if( GUI.Button( new Rect( xPos, yPos += 50, width, 40 ), "Start Updating Location" ) )
{
CoreLocationBinding.startUpdatingLocation();
}
if( GUI.Button( new Rect( xPos, yPos += 50, width, 40 ), "Stop Updating Location" ) )
{
CoreLocationBinding.stopUpdatingLocation();
}
// Second column
xPos += xPos + width;
yPos = 10.0f;
if( GUI.Button( new Rect( xPos, yPos, width, 40 ), "Start Updating Heading" ) )
{
CoreLocationBinding.startUpdatingHeading();
}
if( GUI.Button( new Rect( xPos, yPos += 50, width, 40 ), "Stop Updating Heading" ) )
{
CoreLocationBinding.stopUpdatingHeading();
}
}
}
start中是对 横竖屏的控制下面就不知道了,谁测试下
没做过ios 所以不大懂
好帖就是要顶 说的非常好 很好哦 不错不错 LZ真是人才 很不错 顶顶多好 真心顶 难得一见的好帖