format
typescript
Image.GetAtlasUUID()class: Image
description
Get the atlas UUID of this image object.
An atlas is assigned a globally unique identifier (UUID) to uniquely identify and reference them in code. This ensures that there are no duplicates or conflicts when using atlases in the game.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
string | The atlas UUID. |
code example
typescript
import { LunaEngine } from "LunaEngine";
class NewScriptComponent extends LunaEngine.Component
{
onStart(self: any)
{
// Get the game object attached to this component
let gameObject = self.getGameObject();
// Get the UIComponent
let uiComponent = gameObject.GetComponent(UIComponent);
// Get the Image control
let image = uiComponent.FindChild(ControlType.Image, "Image");
// Get the atlas UUID of this image
let atlasUUID = image.getAtlasUUID();
Debug.Log("Atlas UUID: ", atlasUUID);
}
}