承接动态生成道具功能
效果图:
代码(只记录增加的)
export default class NewClass extends cc.Component {
private prefabs: cc.Node[] = []; //道具列表
private prefabNumber = 10; //道具的最大数量
@property(cc.Node)
pp: cc.Node = null;
isStart = false;
speed = 5;
onLoad() {
...
setTimeout(() => {
...
this.isStart = true