-
Notifications
You must be signed in to change notification settings - Fork 23
Custom properties component
Zsuró Tibor edited this page Jul 14, 2023
·
3 revisions
Here you can store key-value pairs what you can get in runtime.
You should select CUSTOM_PROPERTIES
value in dropdown and click to Add component
button.
After this the custom properties component added to the game object and visible in the Inspector
.
You can add key-value pairs and remove them with the X button.
GameObject go = getYourGameObject();
CustomPropertiesComponent component = (CustomPropertiesComponent) go.findComponentByType(Component.Type.CUSTOM_PROPERTIES);
String hp = component.get("hp");
Gdx.app.log("", "HP: " + hp);