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

请大家帮我看看,到底哪里出了问题(新手在线等)

$
0
0

@skycreat 写道:

是个简单的scene加载的问题,请大家帮忙看一下,我哪里写错了?

button点击后firefox的控制台里如下
undefined(未知)
loadScene: Unknown name type to load: "undefined"cocos2d-js-for-preview.js:21370:25

loadScene: Can not load the scene "undefined" because it was not in the build settings before playing.cocos2d-js-for-preview.js:21391:17

源码如下
cc.Class({
extends: cc.Component,

properties: {
    tt:‘TwoPlay’,
},

// use this for initialization
onLoad: function () {
    this.node.on('mousedown',function(){
        cc.log(this.tt);
        cc.director.loadScene(this.tt);
        //cc.director.loadScene('TwoPlay');(使用这句是可以正确跳转到TwoPlay页面的)
    })
},

});

上传中...

帖子: 4

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



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