All pastes #1436100 Raw Edit

DeviceOrientationHandler.cs

public text v1 · immutable
#1436100 ·published 2009-05-27 11:18 UTC
rendered paste body
using UnityEngine;
using System.Collections;

public class DeviceOrientationHandler : MonoBehaviour {
	private iPhoneScreenOrientation currentOrientation;
	void Update () {
		//Debug.Log("(iPhoneScreenOrientation)iPhoneInput.orientation:"+((iPhoneScreenOrientation)iPhoneInput.orientation)+",iPhoneInput.orientation:"+iPhoneInput.orientation);
		
		currentOrientation= (iPhoneScreenOrientation)iPhoneInput.orientation;
		if(currentOrientation== iPhoneScreenOrientation.LandscapeLeft || currentOrientation== iPhoneScreenOrientation.LandscapeRight){
	 		iPhoneSettings.screenOrientation = currentOrientation;
		}
	}
	
}