How to create an array property

how do i create an array property and have like different properties inside of it

arr: [
balloon0bt: {
    default: null,
    type: cc.Node
},
balloon1bt: {
    default: null,
    type: cc.Node
},
balloon2bt: {
    default: null,
    type: cc.Node
},],
1 Like

i’d do it this way (in typescript)

@property(cc.Node)
protected balloons: cc.Node[] = [];

if, instead of array of cc.Node you want a custom component that you also want to edit its properties, then it’s a different approach.

4 Likes

can you show me that approach ?

    balloons: [cc.RichText],

this is how its done in js

2 Likes

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