public static GameUIComponent ToGameUIComponentEx(this GameObject go) { if (go) { GOGUI.ComParameter uel = go.GetComponent <GOGUI.ComParameter>(); if (uel) { return(uel.parameter as GameUIComponent); } else { return(null); } } else { return(null); } }
public static T ToGameUIComponentEx <T>(this GameObject go) where T : GameUIComponent { if (go) { GOGUI.ComParameter uel = go.GetComponent <GOGUI.ComParameter>(); if (uel) { return(uel.parameter as T); } else { return(null); } } else { return(null); } }