11 lines
3.9 KiB
JavaScript
11 lines
3.9 KiB
JavaScript
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||
|
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
|
||
|
$jscomp.SymbolClass=function(a,b){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:b})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(c||"")+"_"+b++,c)}var b=0;return a}();
|
||
|
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
|
||
|
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
|
||
|
$jscomp.iteratorFromArray=function(a,b){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var c=0,d={next:function(){if(c<a.length){var e=c++;return{value:b(e,a[e]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};
|
||
|
$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");
|
||
|
var Fs=require("fire-fs"),getParent=function(a,b){var c=null;try{switch(b.__type__){case "cc.Node":b._parent&&(c=b._parent.__id__);break;case "cc.PrefabInfo":c=b.root.__id__;break;case "cc.Scene":break;default:c=b.node.__id__}}catch(d){Editor.warn(d),Editor.warn(b)}return a[c]};exports.conversion=function(a,b){for(var c=[b._name],d="";b=getParent(a,b);)"cc.Node"===b.__type__&&(d||(d=b._id),c.splice(0,0,b._name));c=c.filter(function(a){return!!a});return{path:c.join("/"),uuid:d}};
|
||
|
exports.search=function(a,b,c,d){var e=[],g=Fs.readJsonSync(a.destPath);a={};for(var h=0;h<g.length;a={$jscomp$loop$prop$item$2:a.$jscomp$loop$prop$item$2},h++){a.$jscomp$loop$prop$item$2=g[h];if(Editor.Utils.UuidUtils.decompressUuid(a.$jscomp$loop$prop$item$2.__type__)===b){if(c&&a.$jscomp$loop$prop$item$2[c]!=d)continue;var k=exports.conversion(g,a.$jscomp$loop$prop$item$2);e.push(k)}Object.keys(a.$jscomp$loop$prop$item$2).some(function(a){return function(f){if((f=a.$jscomp$loop$prop$item$2[f])&&
|
||
|
f.__uuid__===b&&"cc.PrefabInfo"!=a.$jscomp$loop$prop$item$2.__type__&&(!c||a.$jscomp$loop$prop$item$2[c]==d))return f=exports.conversion(g,a.$jscomp$loop$prop$item$2),e.push(f),!0}}(a))}return e};
|