Пример #1
0
    public static T GetILRComponent <T>(this Component t) where T : BaseMono
    {
        T       value = default(T);
        ILRMono mono  = t.GetComponent <ILRMono>();

        value = mono?.Self as T;
        return(value);
    }
Пример #2
0
    public static T GetILRComponent <T>(this GameObject g) where T : BaseMono
    {
        if (g == null)
        {
            return(null);
        }
        T       value = default(T);
        ILRMono mono  = g.GetComponent <ILRMono>();

        value = mono?.Self as T;
        return(value);
    }