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

如何在代码中给node添加js脚本

$
0
0

@745872343 写道:

如题,将js脚本放置于resources中,
var self = this;

    cc.loader.loadRes('test', function (err, script) {
        if (err) {
            cc.log('加载失败' + err)

        } else {
           self.node.addComponent(script);
        }
    });

但是获取脚本失败,提示
Download text failed: /Users/yamato/Desktop/ilive-cocosjs/library/imports/e5/e55bc1b3-8d0a-429a-aa6f-2cf299bb5169.json

帖子: 3

参与者: 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>