Hi, all,
I’m having some curious problems which I can’t find help for in either the iPhone documentation or the forum seach function, so I’m afraid I have no other option than to ask them here!
- iPhone screen orientation:
I know it’s been asked loads before, but I’ve followed the info in those posts:
using UnityEngine;
using System.Collections;
public class ScreenSet:MonoBehaviour {
// Use this for initialization
void Awake () {
iPhoneOrientation.verticalOrientation = false;
}
}
I then drag this script and attach it to the MainCamera (which is my assumption, as there seems to be nowhere which actually tells me this is the right thing to do, but it seems consistent with the iPhone examples). The only thing I haven’t tried is actually making a pre-fab with the camera in?
When I upload the project to the iPhone it’s always in Portrait orientation!!! It’s doing my head in! Really - why isn’t this just a box to click on Unity settings!?
- The 0xE8000001 error. What’s the deal? I’ve had to rebuild my project under a different name since I got this, and having read the forums, it seems that this could be due to a partially installed build of the project “lodged” in my iPhone? These things only have 16Gig, so space is at a premium! How do I get rid of it?
There’s more to come, but that’s good for starters! Thanks in advance to anyone who can help me!
SB
Put it into the Start instead of Awake
Awake is only called once for the main cam so if you switch level it will no longer be correct.
- reset the device, a common joy among iPhone devs of all kind, not only unity
The “Start” thing doesn’t work - I’ve actually just noticed an error being reported at the bottom of the unity window, which is odd:
Assets/SetScreen.cs(8,17):error CS0117: ‘UnityEngine.iPhoneOrientation’ does not contain a definition for ‘verticalOrientation’
Huh?
Also - the restarting of my iPhone didn’t work to flush the broken app - it still doesn’t work…
Help!
too obvious to see it.
its iPhoneSettings.verticalOrientation
Sorry - sorted on the orientation thing. Even though Unity Script editor was reporting that I’d entered the right thing (iPhoneOrientation.verticalOrientation) what I actually needed to use was iPhoneSettings.verticalOrientation.
Sorted for now.
Broken file thing is still an issue, though. Seeing as I’ve re-built my project now, is there any way to easily rename a Unity project prior to release in the AppleStore?
Thx.
the editor does not have any capability to tell you whats wrong or right.
The only thing it does is color classes and fields that are known in unity, but that does not needfully mean that the combination in which you enter them is also valid known.
You can code with visual studio, which will give you some of that extra layer help with intellisense etc.etc.
Highly recommendable