TypeScript参数设置

QRrNA
Thu, 19 Jul 2018 03:54:51 +0000

var Helpers = require(‘Helpers’);

cc.Class({
extends: cc.Component,

properties: {
    spriteList: {
        default: [],
        type: [cc.SpriteFrame]
    }
},

// use this for initialization
onLoad: function () {
    var randomIdx = Helpers.getRandomInt(0, this.spriteList.length);
    var sprite = this.getComponent(cc.Sprite);
    sprite.spriteFrame = this.spriteList[randomIdx];
}

});

TS能不能出个详细的文档啊，我这里想像这样创建一个node集合，用ts写properties部分创建array应该怎么写？

阅读整个主题