private static void OnSetPickerContentFromApiModel(UiUserList __instance, VRCUiContentButton __0, Il2CppSystem.Object __1) { if (!ShouldAdjustList(__instance)) { return; } APIUser user = __1.TryCast <APIUser>(); if (user == null) { return; } GameObject icon = __0.field_Public_VRCUiDynamicOverlayIcons_0.field_Public_ArrayOf_GameObject_0.First(gameObject => gameObject.name == "PrivateInstanceIcon"); if (UserInstanceSprite(user) is Sprite sprite) { icon.GetComponent <Image>().sprite = sprite; icon.SetActive(true); } else { icon.SetActive(false); } }
/// <summary> /// (Cross-Game compatible) Check if object is the same type as T /// </summary> /// <param name="instance"></param> /// <param name="castObject">The casted object if this is of type T</param> /// <typeparam name="T">Type to check</typeparam> public static bool IsType <T>(this Object instance, out T castObject) where T : Object { castObject = instance.TryCast <T>(); return(castObject != null); }
/// <summary> /// (Cross-Game compatible) Check if object is the same type as T /// </summary> /// <typeparam name="T">Type to check</typeparam> public static bool IsType <T>(this Object instance) where T : Object { return(instance.TryCast <T>() != null); }