cc.Class({
    extends: cc.Component,

    properties: {

        // defaults, set visually when attaching this script to the Canvas
    },

    // use this for initialization
    onLoad: function () {

    },

    // called every frame
    update: function (dt) {

    },
    click:function(event,customData){
        cc.log("click",customData);
        var self = this;
        if(customData == "load"){
            cc.loader.loadRes("cocos", function (err, prefab) {
                cc.log("err:",err);
                var newNode = cc.instantiate(prefab);
                self.node.addChild(newNode);
            });
        }else if(customData == "release"){
            var deps = cc.loader.getDependsRecursively("cocos");
            cc.log("deps",JSON.stringify(deps));
            cc.loader.release(deps);
        }
    }
});
