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