using UnityEngine;
using System.Collections;
public class SceneManager : MonoBehaviour
{
private static SceneManager s_Instance = null;
public static SceneManager instance
{
get
{
if(s_Instance == null)
{
s_Instance = FindObjectOfType(typeof(SceneManager)) as SceneManager;
}
if(s_Instance == null)
{
GameObject obj = new GameObject("SceneManager");
s_Instance = obj.AddComponent(typeof(SceneManager)) as SceneManager;
Debug.Log ("Could not locate an SceneManager object. \ SceneManager was Generated Automaticly.");
}
}
return s_Instance;
}
void OnApplicationQuit()
{
s_Instance = null;
}
public void DoSomeThing()
{
Debug.Log("Doing something now", this);
}
}