properties: {
// this property quotes the PreFab resource of stars
starPrefab: {
default: null,
type: cc.Prefab
},
// the random scale of disappearing time for stars
maxStarDuration: 0,
minStarDuration: 0,
// ground node for confirming the height of the generated star's position
ground: {
default: null,
type: cc.Node
},
// player node for obtaining the jump height of the main character and controlling the movement switch of the main character
player: {
default: null,
type: cc.Node
}
},
properties: {
score: {
default: 0,
displayName: "Score (player)",
tooltip: "The score of player",
}
}
how can i this declaration in typescript?
now im not use array just like this :
@property(cc.Prefab) starPrefab: cc.Prefab = null;
@property(cc.Node) ground : cc.Node = null;
@property(cc.Node) player : cc.Node = null;
@property maxStarDuration: number = 0;
@property minStarDuration: number = 0;
and try like this too, but it’s not work on Creator’s Node list (can’t drag and can’t set value)
@property({
score : {
default : 0,
displayName : "Score(Player)",
tooltip : "The score of Player"
}
})