Get properties of prefab node

Hello everyone, i was trying to make List data just like in here. But i dont know how to get all thoose properties. i’ve been searching and try it myself but still i cant get the properties.

Example, i have data like this


– ID : 0
– Name : Sword

– ID : 1
– Name : Shield

how do i got param ID ? i try using this.node.ID, yes i know its wrong cause i dont know the idea. my prefab root node was a button, so when the button clicked, i need to get the ID.

i was trying to give tag to the prefab too but i got warning tag was removed in Cocos creator 2.4.3. anyone can give me a advice ? Thanks.

Hi, you can use node.getComponent('ItemList').items[0].id

1 Like

Actually when im using touchend listener i cant get the ID. now im using EventTouch and its working. Thanks Before

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.