Skip to content

EAUploader.Editor.Resource.API

Public API that provides EAUploader’s styles and custom UI component features. Defined in Editor/Public EAUploader API/EAUploader.Editor.Resource.API.cs.

using EAUploader.Editor.Resource.API;

For details on each component, see “UI Components”.

ClassDescription
EAUResourceAPIProvides EAUploader’s stylesheets
HelpButtonAPIShows help messages
LinkAPICreates links
MaterialIconAPICreates material icons
PrefabItemButtonAPICreates prefab item buttons
ShadowButtonAPICreates shadow buttons
PreviewAPIProvides interactive avatar previews

EAUResourceAPI


PropertyTypeDescription
EAUStylesStyleSheetEAUploader’s stylesheet
EAUTailwindStyleSheetTailwind stylesheet
public static StyleSheet EAUStyles { get; }
public static StyleSheet EAUTailwind { get; }
  • These are loaded when EAUploader’s main window is shown. They are null if the main window has never been shown. To get them reliably, use Resources.Load<StyleSheet>("UI/styles") and Resources.Load<StyleSheet>("UI/tailwind").

HelpButtonAPI


MethodTypeDescription
ShowMessageVoidShows a window with the message of the specified message number
public static void ShowMessage(int msgNum);
  • Messages are loaded from Editor/Resources/Message/{language code}/{message number}.txt of EAUploader itself. For the message numbers in use, see “Localization and Resources”.

LinkAPI


MethodTypeDescription
CreateLinkVisualElementCreates a link with the specified text and URL
public static VisualElement CreateLink(string text, string url);

MaterialIconAPI


MethodTypeDescription
CreateMaterialIconVisualElementCreates a material icon with the specified icon name
public static VisualElement CreateMaterialIcon(string iconName);
  • Specify an icon name from Material Icons.
  • To show icons, EAUStyles (UI/styles) must be applied.

PrefabItemButtonAPI


MethodTypeDescription
CreatePrefabItemButtonVisualElementCreates a prefab item button with the specified prefab information and click action
public static VisualElement CreatePrefabItemButton(PrefabInfo prefab, Action clickAction, bool disabled = false);
  • PrefabInfo is EAUploader.CustomPrefabUtility.PrefabInfo. A list with preview images can be obtained with PrefabManager.GetAllPrefabsWithPreview().
  • When disabled is true, buttons for avatars that cannot be uploaded cannot be pressed.

ShadowButtonAPI


MethodTypeDescription
CreateShadowButtonVisualElementCreates a shadow button with the specified text and click action
public static VisualElement CreateShadowButton(string text, Action clickAction);

PreviewAPI


This preview is not a Texture2D preview but a rendered preview that can be operated with the mouse.

MethodTypeDescription
CreatePreviewPreviewCreates a preview with the specified root element and prefab path
ShowContentVoidShows the preview content
UpdatePreviewVoidUpdates the preview with the specified prefab path
ResetPreviewVoidResets the preview
public static Preview CreatePreview(VisualElement rootElement, string prefabPath);
public static void ShowContent(Preview preview);
public static void UpdatePreview(Preview preview, string prefabPath);
public static void ResetPreview(Preview preview);