Esempio n. 1
0
 public static void init()
 {
     if (instance == null)
     {
         instance = new GameRoot_Test();
     }
 }
Esempio n. 2
0
    public static T getSingleton <T>() where T : Singleton <T>
    {
        if (instance == null)
        {
            instance = new GameRoot_Test();
        }


        return(null);
        //return instance.rootObj.GetComponent<T>();
    }
Esempio n. 3
0
    public static T addSingleton <T>(GameObject gameObject) where T : Singleton <T>
    {
        if (instance == null)
        {
            instance = new GameRoot_Test();
        }

        T t = gameObject.AddComponent <T>();

        t.Init();
        return(t);
    }
Esempio n. 4
0
    //GameObject rootObj = null;

    private GameRoot_Test()
    {
        //rootObj = new GameObject("GameRoot");
        instance = this;
    }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     GameRoot_Test.init();
 }