123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.SimpleParse = void 0;
- const WBaseComParse_1 = require("./WBaseComParse");
- class SimpleParse extends WBaseComParse_1.BaseComParse {
- constructor() {
- super(...arguments);
- this._simpleKeys = [
-
- '_customMaterial',
- '_atlas',
- '_spriteFrame',
-
- '_font',
-
- '_normalSprite',
- '_hoverSprite',
- '_pressedSprite',
- '_disabledSprite',
-
- '_mesh',
-
- '_defaultClip',
-
- '_clip',
-
- '_imageAtlas',
-
- '_dragonAsset',
- '_dragonAtlasAsset',
-
- '_texture',
-
- '_file',
-
- '_material',
-
- '_skeletonData',
-
- '_tmxFile',
-
- '_backgroundImage',
-
- 'value',
-
- 'asset',
- ];
- this._arrayKeys = [
- '_materials',
- '_clips',
- ];
- this.comName = '';
- }
-
- async parse(json, fatherJson, fullUuid, compressedUuid) {
- this.comName = json.__type__;
- let ret = [];
-
- for (let simpleKey of this._simpleKeys) {
- if (json[simpleKey]) {
- let uuid = json[simpleKey].__uuid__;
- if (uuid) {
- if (uuid.includes(fullUuid) || uuid.includes(compressedUuid)) {
- ret.push(simpleKey);
- }
- }
- }
- }
- for (let arrayKey of this._arrayKeys) {
- if (json[arrayKey]) {
- let i = -1;
- for (let ele of json[arrayKey]) {
- i++;
- if (!ele)
- continue;
- let uuid = ele.__uuid__;
- if (!uuid)
- continue;
- if (uuid.includes(fullUuid) || uuid.includes(compressedUuid)) {
- ret.push(arrayKey + '[' + i + ']');
- }
- }
- }
- }
- return ret;
- }
- }
- exports.SimpleParse = SimpleParse;
|