- Home /
Setting Game Up for Multiple Platforms
OK, so this should be obvious, but I am not finding any documentation on it.
After my game is built, and I need to specialize each build for its particular device, how do I do that?
Do I make multiple copies of the same project? If so, how?
Examples of things I need to specialize are input, camera zoom, and screen orientation.
Answer by kacyesp · Aug 31, 2014 at 02:33 AM
There's a forum thread I found that's dedicated to answering this question: http://forum.unity3d.com/threads/how-do-you-maintain-multiple-platforms-at-the-same-time.189336/
Answer by Endless_Aftermath · Aug 31, 2014 at 02:22 AM
Probably the best way I've seen is to copy all your scripts that are platform dependant and do a check for certain criteria.
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Start() {
if (Application.platform == RuntimePlatform.WindowsPlayer)
print("Do something special here!");
}
}
That makes it rather inconvenient to adjust the camera and such. I was hoping to avoid that.
Answer by BMayne · Aug 31, 2014 at 02:29 AM
Hello There,
You don't have to do anything special for each platform. You can just build your project. If you are building for mobile you can't use the crazy shaders you were using for desktop. In that case you would have to switch them out for the new platform. There are a few settings you can tweak in player settings in the Unity Menu.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Is there a #define for Build Settings Platform? 1 Answer
how to run two games? 1 Answer
How Can You Make Wii Games In Unity 1 Answer
Crossplatform Windows and Android: How to share same codebase? 3 Answers