Assets and localization
Organize assets by purpose:
MyModule/├── images/│ ├── Icon.png│ └── Hud/Background.png├── sounds/│ └── Alert.ogg├── ui/│ ├── Panel.uxml│ └── Panel.uss└── localization.csvImages
Section titled “Images”PNG, JPG, and JPEG are supported. Lua paths are normally relative to images:
local background = Textures:GetTexture("Hud/Background.png")
if background == nil then print("Background was not loaded")endUse exact casing, an extension, and forward slashes. Images above 4096 × 4096 or 10 MiB are skipped.
Sounds
Section titled “Sounds”WAV, MP3, and OGG are supported:
local alert = Sounds:GetSound("Alert.ogg")
if alert ~= nil then Sounds:PlaySound2D(alert, 0.7, 1)endLoad the asset once rather than inside every frame or event.
UXML and USS
Section titled “UXML and USS”Store markup and styles under ui. A UXML file can include a neighboring USS file:
<ui:UXML xmlns:ui="UnityEngine.UIElements"> <Style src="./Panel.uss" /> <ui:VisualElement name="Root" class="panel" /></ui:UXML>An image path in ui/Panel.uss is relative to that USS file:
.panel { background-image: url("../images/Hud/Background.png");}Localization
Section titled “Localization”The root localization.csv uses ; as its delimiter:
Keys;English (United States);RussianPanelTitle;Status;СостояниеEnabled;Enabled;ВключеноRead a string in Lua:
local title = Localization:GetTranslation("PanelTitle")An empty current-language cell falls back to English. A completely missing key returns the key itself.
Description images
Section titled “Description images”images/Icon.png: module icon;images/DescriptionImage.png: large description image.
Before publishing
Section titled “Before publishing”- remove unused source assets;
- verify path casing against file names;
- fill the English value for every localization key;
- keep the total package within the module size limit;
- test after copying into a clean folder.
Reference: Texture, Audio, Localization, and UXML.