Ejemplo n.º 1
0
    public static SGT_LightSource Find()
    {
        if (instance != null)
        {
            return(instance);
        }

        instance = SGT_Helper.Find <SGT_LightSource>();

        return(instance);
    }
Ejemplo n.º 2
0
    public static void RequireInstance()
    {
        if (instance == null)
        {
            instance = SGT_Helper.Find <T>();

            if (instance == null)
            {
                new GameObject(typeof(T).Name).AddComponent <T>();

                if (instance == null)
                {
                    Debug.LogError("Something went wrong!");
                }
            }
        }
    }