- Home /
Windows Phone 8 : changes in MainPage.xaml.cs
Hi all,
I would like to handle phone rotation on Windows Phone (for some gameplay behaviour) but i don't want Unity to be allowed to rotate from landscape to portait. I either don't want to have a class with an Update() function checking for Input.DeviceOrientation.
I found a method in MainPage.xaml.cs (PhoneApplicationPage_OrientationChanged) which does exactly what I want, but if I modify this file, I need to change it every time I build my application.
Does someone know if there is a place I can put the modified file in the Unity project (like for AppController.mm for iOS) who will replace the Unity's one by my own ? or should I copy the modified file myself in a BuildPostProcess function ?
Answer by pitimoi · Sep 08, 2014 at 09:43 PM
Finaly, we fixed this problem by adding the file in an editor folder with a BuildPostProcess to copy the file at each build.
You can see the reasons about this choice in my comment to @neerajcrespo answer.
Answer by neerajcrespo · Sep 03, 2014 at 01:16 PM
you wont need to change this everytime. As the new build from Unity will just replace data folder, and not your xaml files.
Actually no, we got a continuous integration system and did not added the windows phone project to our files repository (this is a choice made a long time ago due to errors with xcode projects creations, and its pretty hard to change pipeline like that in a company...) The windows phone project in visual studio is re-created each time we ask the system for a new build :(