I have been wondering how to manage different scenes for different platforms.
I understand that a lot of stuff can be managed for graphics with quality presets, but for my VR game, I want to have 1 scene with 1 different part being just 1 changed game object.
Using Git branches is pretty much out of the question I think and using multiple scenes would work, but it might be annoying to copy over the objects each time.
I did get something to work with prefabs, but it felt more like a workaround.
Do people have experience with this to target different platforms?
I just have a master switchboard class that goes to the correct scene.
For instance I have a method in there called GotoMainMenu() and on iPhone / Android it will go to a mainmenu scene that has buttons on it. When it runs on my Android TV (or other console targets) it goes to another mainmenu scene that operates via controller.
I use git branches for platforms but I only change the tiniest barest minimum of files, usually just a single text file (kurtconfig.txt) that indicates the target branch, and I have my configuration program read that.
Otherwise I do ALL work in master.
Here’s the diff on that file from master (phone/tablet) to tv:
That file is read by:
using UnityEngine;
using System.Collections;
public class configure : UnitySingleton<configure>
{
public bool TV;
public bool PC;
public bool WebGL;
public bool CTRLR { get { return TV; }}
public bool Monitor { get { return TV || PC || WebGL; } }
public bool hasKB { get { return Application.isEditor || PC || WebGL; } }
public bool hasTouch { get { return !TV && !PC && !WebGL; } }
public bool CanUseKeyboardOrJoystick { get { return TV || hasKB; } }
void Awake()
{
TV = false;
PC = false;
WebGL = false;
TextAsset ta = Resources.Load<TextAsset>("kurtconfig");
if (ta != null && ta)
{
if (ta.text != null && ta.text.Length >= 2)
{
if (ta.text.StartsWith( "tv"))
{
TV = true;
}
if (ta.text.StartsWith( "pc"))
{
PC = true;
}
if (ta.text.StartsWith( "web"))
{
WebGL = true;
}
}
}
}
}
There are no other changes in the codebase between branches. All work is done in master and then merged to tv, pc, webgl branches as released.
I made a release of Jetpack a few days back, master, tv and pc, so my git branches look like: