Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 91349

出现这种问题是什么情况?都是按教程来的

$
0
0

@skycreat 写道:

The "type" attribute of "touxiang.lbn" is undefined when loading script.

cc.Class({
extends: cc.Component,

properties: {
    lbn:{
        default:null,
        type:cc.Lable
    },
    touxiang:{
        default:null,
        type:cc.Sprite
    },
    tupian:{
        default:[],
        type:cc.SpriteFrame
    }
},
onLoad: function () {
    function gettouxiang(min,max){
    var ma=cc.random0to1();
    return min+Math.floor((max-min)*ma);
    }
    var maa=gettouxiang(1,this.tupian.lenth);
    this.lbn.String=maa.toString();
    this.touxiang.SpriteFrame=tupian[maa];
},

});

帖子: 3

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 91349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>