One Scene multiple themes??

How would I go about implementing a system in which I could change the theme of the game and the objects and background would change?? It is a endless runner meaning it uses just one scene for the game, and I feel creating a new scene would not be most efficient.

At the moment the standard objects are pooled and spawn on the game with the background set to the camera.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ObjectPooler : MonoBehaviour {

    public GameObject pooledObject;

    public int pooledAmount;

    List<GameObject> pooledObjects;



    // Use this for initialization
    void Start ()
    {
        pooledObjects = new List<GameObject>();

        for (int i = 0; i < pooledAmount; i++)
       
        {
            GameObject obj = Instantiate (pooledObject);
            obj.SetActive (false);
            pooledObjects.Add (obj);

        }
   
    }

    public GameObject GetPooledObject()
    {
        for (int i = 0; i < pooledObjects.Count; i++)
        {
            if (!pooledObjects [i].activeInHierarchy)
            {
                return pooledObjects[i];
            }
        }

        GameObject obj = Instantiate (pooledObject);
        obj.SetActive (false);
        pooledObjects.Add (obj);
        return obj;
    }

}

That is my Object Pooling Script but tbh I am unsure what I should do. I have read about XML Serialization but not really sure if that is what I would need!

Thanks,

Harraj

You didn’t give much details, but how about making prefabs of the themes? That’s a quick thing that i can think of that you can plan in advance and then instantiate when needed.

Couldn’t you create a Theme class that had data about textures your using for your game:

public class Theme
{
       Texture2D background;
       Texture2D[] platformTextures = Texture2d[10];
       AudioClip gbMusic;
        //etc
}

Then you could either load an array of these themes at game start up or (depending on memory requirements) load up a new theme after a set amount of time, staggering the load across multiple frames while the game was being played.

Then after the Theme was all loaded, you just set all the new textures to the various correct places, change your bg music, etc.

I would approach it a different way. Have your pool responsible for swapping out objects. So when it’s time to change theme your pool removes the old objects and puts in new ones.