public static T FindOrAddComponent <T>(this GameObject go) where T : Component
    {
        T val = go.GetComponent <T>();

        if ((UnityEngine.Object)val == (UnityEngine.Object)null)
        {
            val = go.AddComponent <T>();
            KMonoBehaviour kMonoBehaviour = val as KMonoBehaviour;
            if ((UnityEngine.Object)kMonoBehaviour != (UnityEngine.Object)null && !KMonoBehaviour.isPoolPreInit && !kMonoBehaviour.IsInitialized())
            {
                Debug.LogErrorFormat("Could not find component " + typeof(T).ToString() + " on object " + go.ToString());
            }
        }
        else
        {
            InitializeComponent(val);
        }
        return(val);
    }