This works…
if(Screen.orientation == 0)
{
print("P");
return;
}
if(Screen.orientation == 1)
{
print("PUD");
return;
}
but this doesn’t.
I am thinking, that it is only seeing 2 orientations.
if(Screen.orientation == 0)
{
print("P");
return;
}
if(Screen.orientation == 1)
{
print("PUD");
return;
}
if(Screen.orientation == 2)
{
print("POO");
return;
}
going to try some stuff.
oh and full code,
sorry for all the messy garbledee gook.
function OnGUI() {
print("Screen.orientation " + Screen.orientation);
if(Screen.orientation == 0)
{
//var leftBtn = GUI.RepeatButton (Rect (10, 790, 200, 400), leftBtnImage, guiStyle);
//var rightBtn = GUI.RepeatButton (Rect (420, 790, 200, 400), rightBtnImage, guiStyle);
//var pauseBtn = GUI.Button(Rect(10, 10, 10, 10), pauseBtnImage, guiStyle);
print("P");
return;
}
if(Screen.orientation == 1)
{
//leftBtn = GUI.RepeatButton (Rect (10, 790, 200, 400), leftBtnImage, guiStyle);
//rightBtn = GUI.RepeatButton (Rect (420, 790, 200, 400), rightBtnImage, guiStyle);
//pauseBtn = GUI.Button(Rect(10, 10, 10, 10), pauseBtnImage, guiStyle);
print("PUD");
return;
}
if(Screen.orientation == 2)
{
//leftBtn = GUI.RepeatButton (Rect (10, 790, 200, 400), leftBtnImage, guiStyle);
//rightBtn = GUI.RepeatButton (Rect (420, 790, 200, 400), rightBtnImage, guiStyle);
//pauseBtn = GUI.Button(Rect(10, 10, 10, 10), pauseBtnImage, guiStyle);
print("POO");
return;
}
/*
if(pauseBtn){
print("pause game");
if (Time.timeScale == 1.0){
btnCommenceData.commenceVar = false; ///var freezes update charctrl movement
Time.timeScale = 0.0;
}
else if(Time.timeScale == 0.0){
btnCommenceData.commenceVar = true;
Time.timeScale = 1.0;
}
}
if(Time.timeScale == 0.0) ///pause
return;
if (leftBtn) {
print ("you clicked the left");
if(btnCommenceData.commenceVar == false) /// crnt offical pause var
return;
print("btnCommenceData.commenceVar " + btnCommenceData.commenceVar);
brainCtrlr.Move(leftGravity);
cameraCtrlr.Move(leftGravity);
//leftBtn = GUI.RepeatButton (Rect (10, 10, 50, 100), rightBtnImage, guiStyle);
}
if (rightBtn) {
print ("you clicked the right");
if(btnCommenceData.commenceVar == false) /// crnt offical pause var
return;
print("btnCommenceData.commenceVar " + btnCommenceData.commenceVar);
brainCtrlr.Move(rightGravity);
cameraCtrlr.Move(rightGravity);
} */
}