@realsee/dnalogel 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/PrXel3aqGbp34JQn.js +10 -2
- package/package.json +1 -1
- package/plugins/TreasurePlugin/Controller.d.ts +42 -9
- package/plugins/TreasurePlugin/Controller.js +88 -52
- package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +8 -6
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +4 -4
- package/plugins/TreasurePlugin/TreasureObject.d.ts +19 -11
- package/plugins/TreasurePlugin/TreasureObject.js +145 -51
- package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +4 -2
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +10 -5
- package/plugins/TreasurePlugin/constants.d.ts +32 -11
- package/plugins/TreasurePlugin/constants.js +52 -17
- package/plugins/TreasurePlugin/index.d.ts +5 -5
- package/plugins/TreasurePlugin/index.js +8 -0
- package/plugins/floorplan/typings/floorplanData.d.ts +5 -1
- package/plugins/floorplan/utils/formatData.js +1 -22
- package/shared-utils/isNil.d.ts +10 -0
- package/shared-utils/isNil.js +24 -0
- package/shared-utils/three/getExtraModelLoader.d.ts +6 -0
- package/shared-utils/three/getExtraModelLoader.js +31 -0
- package/shared-utils/three/getTextureLoader.d.ts +6 -0
- package/shared-utils/three/getTextureLoader.js +34 -0
- package/shared-utils/three/loadFbxObj.d.ts +1 -2
- package/shared-utils/three/loadFbxObj.js +6 -2
- package/shared-utils/to.d.ts +0 -1
- package/shared-utils/to.js +45 -7
- package/typedoc/plugins.d.ts +1 -1
- package/typedoc/plugins.js +24 -12
- package/plugins/TreasurePlugin/treasureDataMap.d.ts +0 -7
- package/plugins/TreasurePlugin/treasureDataMap.js +0 -20
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.d.ts +0 -7
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.js +0 -115
|
@@ -5,16 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.loadFbxObj = loadFbxObj;
|
|
7
7
|
|
|
8
|
+
var _FBXLoader = require("three/examples/jsm/loaders/FBXLoader");
|
|
9
|
+
|
|
8
10
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
11
|
|
|
10
12
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
var loader = new _FBXLoader.FBXLoader();
|
|
15
|
+
|
|
16
|
+
function loadFbxObj(_x) {
|
|
13
17
|
return _loadFbxObj.apply(this, arguments);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
function _loadFbxObj() {
|
|
17
|
-
_loadFbxObj = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(
|
|
21
|
+
_loadFbxObj = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url) {
|
|
18
22
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
19
23
|
while (1) {
|
|
20
24
|
switch (_context.prev = _context.next) {
|
package/shared-utils/to.d.ts
CHANGED
package/shared-utils/to.js
CHANGED
|
@@ -6,19 +6,57 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
exports.to = to;
|
|
8
8
|
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
|
|
11
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
12
|
+
|
|
9
13
|
/**
|
|
10
14
|
* 传入一个 Promise
|
|
11
15
|
* 无异常,返回 [null, data]
|
|
12
16
|
* 有异常,则返回 [Error, undefined]
|
|
13
17
|
* 用于替代 try&catch 处理 await 异常的方案
|
|
14
|
-
* @param {Promise} promise 传入一个 Promise
|
|
15
18
|
*/
|
|
16
|
-
function to(
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
function to(_x) {
|
|
20
|
+
return _to.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _to() {
|
|
24
|
+
_to = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(promise) {
|
|
25
|
+
var data;
|
|
26
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
27
|
+
while (1) {
|
|
28
|
+
switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
_context.prev = 0;
|
|
31
|
+
_context.next = 3;
|
|
32
|
+
return promise;
|
|
33
|
+
|
|
34
|
+
case 3:
|
|
35
|
+
data = _context.sent;
|
|
36
|
+
return _context.abrupt("return", [null, data]);
|
|
37
|
+
|
|
38
|
+
case 7:
|
|
39
|
+
_context.prev = 7;
|
|
40
|
+
_context.t0 = _context["catch"](0);
|
|
41
|
+
|
|
42
|
+
if (!(_context.t0 instanceof Error)) {
|
|
43
|
+
_context.next = 11;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return _context.abrupt("return", [_context.t0, null]);
|
|
48
|
+
|
|
49
|
+
case 11:
|
|
50
|
+
return _context.abrupt("return", [new Error(''), null]);
|
|
51
|
+
|
|
52
|
+
case 12:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, _callee, null, [[0, 7]]);
|
|
58
|
+
}));
|
|
59
|
+
return _to.apply(this, arguments);
|
|
22
60
|
}
|
|
23
61
|
|
|
24
62
|
var _default = to;
|
package/typedoc/plugins.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export type { FloorplanServerPosition, FloorplanServerImagePosition, FloorplanSe
|
|
|
14
14
|
export type { FloorplanData, FloorplanEntrance, FloorplanBounding, FloorplanPosition, FloorplanRoomItem, FloorplanObserver, FloorplanFloorData, FloorplanOutlineItem, FloorplanImagePosition, FloorplanRoomLabelItem, FloorplanExtraObject, FloorplanExtraObject3D, } from '../plugins/floorplan/typings/floorplanData';
|
|
15
15
|
export { TopviewFloorplanPlugin, TopviewFloorplanPluginParameterType, } from '../plugins/floorplan/TopviewFloorplanPlugin';
|
|
16
16
|
export { TopviewFloorplanPluginController } from '../plugins/floorplan/TopviewFloorplanPlugin/Controller';
|
|
17
|
-
export {
|
|
17
|
+
export { TREASURE_TYPE, TreasurePlugin, TreasurePluginData, TreasurePluginItemData, TreasurePluginItemConfigData, TreasurePluginEvents, TreasurePluginController, TreasurePluginReturnType, TreasurePluginParameterType, TreasureObject, TreasureObjectConfig, TreasureObjectParams, TreasureFaceAnime, TreasureFaceAnimeParams, TreasureOpenAnimeParams, TreasurePluginOpenAnime, } from '../plugins/TreasurePlugin';
|
package/typedoc/plugins.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "TREASURE_TYPE", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _TreasurePlugin.TREASURE_TYPE;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "TopviewFloorplanPlugin", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function get() {
|
|
@@ -27,10 +33,10 @@ Object.defineProperty(exports, "TreasureFaceAnime", {
|
|
|
27
33
|
return _TreasurePlugin.TreasureFaceAnime;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "TreasureFaceAnimeParams", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function get() {
|
|
33
|
-
return _TreasurePlugin.
|
|
39
|
+
return _TreasurePlugin.TreasureFaceAnimeParams;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
36
42
|
Object.defineProperty(exports, "TreasureObject", {
|
|
@@ -39,16 +45,22 @@ Object.defineProperty(exports, "TreasureObject", {
|
|
|
39
45
|
return _TreasurePlugin.TreasureObject;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "TreasureObjectConfig", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _TreasurePlugin.TreasureObjectConfig;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "TreasureObjectParams", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
45
|
-
return _TreasurePlugin.
|
|
57
|
+
return _TreasurePlugin.TreasureObjectParams;
|
|
46
58
|
}
|
|
47
59
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
60
|
+
Object.defineProperty(exports, "TreasureOpenAnimeParams", {
|
|
49
61
|
enumerable: true,
|
|
50
62
|
get: function get() {
|
|
51
|
-
return _TreasurePlugin.
|
|
63
|
+
return _TreasurePlugin.TreasureOpenAnimeParams;
|
|
52
64
|
}
|
|
53
65
|
});
|
|
54
66
|
Object.defineProperty(exports, "TreasurePlugin", {
|
|
@@ -75,6 +87,12 @@ Object.defineProperty(exports, "TreasurePluginEvents", {
|
|
|
75
87
|
return _TreasurePlugin.TreasurePluginEvents;
|
|
76
88
|
}
|
|
77
89
|
});
|
|
90
|
+
Object.defineProperty(exports, "TreasurePluginItemConfigData", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _TreasurePlugin.TreasurePluginItemConfigData;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
78
96
|
Object.defineProperty(exports, "TreasurePluginItemData", {
|
|
79
97
|
enumerable: true,
|
|
80
98
|
get: function get() {
|
|
@@ -99,12 +117,6 @@ Object.defineProperty(exports, "TreasurePluginReturnType", {
|
|
|
99
117
|
return _TreasurePlugin.TreasurePluginReturnType;
|
|
100
118
|
}
|
|
101
119
|
});
|
|
102
|
-
Object.defineProperty(exports, "TreasureType", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function get() {
|
|
105
|
-
return _TreasurePlugin.TreasureType;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
120
|
|
|
109
121
|
var _TopviewFloorplanPlugin = require("../plugins/floorplan/TopviewFloorplanPlugin");
|
|
110
122
|
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.treasureDataMap = void 0;
|
|
7
|
-
|
|
8
|
-
var _constants = require("./constants");
|
|
9
|
-
|
|
10
|
-
/** 不同宝箱类型对应的数据 */
|
|
11
|
-
var treasureDataMap = new Map();
|
|
12
|
-
exports.treasureDataMap = treasureDataMap;
|
|
13
|
-
treasureDataMap.set(_constants.TreasureType.TreasureType1, {
|
|
14
|
-
type: _constants.TreasureType.TreasureType1,
|
|
15
|
-
textureUrl: _constants.TREASURE_BASE_URL + 'box_Base_Color.png'
|
|
16
|
-
});
|
|
17
|
-
treasureDataMap.set(_constants.TreasureType.TreasureType2, {
|
|
18
|
-
type: _constants.TreasureType.TreasureType2,
|
|
19
|
-
textureUrl: _constants.TREASURE_BASE_URL + 'box_Base_Color_red.png'
|
|
20
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TreasurePluginData } from '../Controller';
|
|
2
|
-
import { Group, Texture } from 'three';
|
|
3
|
-
import { TreasureMapItem } from '../treasureDataMap';
|
|
4
|
-
export declare function loadTreasureTextures(data: TreasurePluginData, baseFbxObjPromise: Promise<Group>): Promise<{
|
|
5
|
-
treasureMapItem: TreasureMapItem;
|
|
6
|
-
texture: Texture;
|
|
7
|
-
}[]>;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.loadTreasureTextures = loadTreasureTextures;
|
|
7
|
-
|
|
8
|
-
var _loadTexture = require("../../../shared-utils/three/loadTexture");
|
|
9
|
-
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
|
|
12
|
-
var _treasureDataMap = require("../treasureDataMap");
|
|
13
|
-
|
|
14
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
|
-
|
|
16
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
-
|
|
18
|
-
function loadTreasureTextures(_x, _x2) {
|
|
19
|
-
return _loadTreasureTextures.apply(this, arguments);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function _loadTreasureTextures() {
|
|
23
|
-
_loadTreasureTextures = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data, baseFbxObjPromise) {
|
|
24
|
-
var types, treasureTexturePromise;
|
|
25
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
26
|
-
while (1) {
|
|
27
|
-
switch (_context.prev = _context.next) {
|
|
28
|
-
case 0:
|
|
29
|
-
// 需要加载的所有宝箱种类
|
|
30
|
-
types = Array.from(new Set(data.treasures.map(function (treasure) {
|
|
31
|
-
return treasure.type;
|
|
32
|
-
})));
|
|
33
|
-
treasureTexturePromise = Promise.all(types.map(function (type) {
|
|
34
|
-
return loadTreasureTextureWithType(type, baseFbxObjPromise);
|
|
35
|
-
}));
|
|
36
|
-
return _context.abrupt("return", treasureTexturePromise);
|
|
37
|
-
|
|
38
|
-
case 3:
|
|
39
|
-
case "end":
|
|
40
|
-
return _context.stop();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, _callee);
|
|
44
|
-
}));
|
|
45
|
-
return _loadTreasureTextures.apply(this, arguments);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function loadTreasureTextureWithType(_x3, _x4) {
|
|
49
|
-
return _loadTreasureTextureWithType.apply(this, arguments);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _loadTreasureTextureWithType() {
|
|
53
|
-
_loadTreasureTextureWithType = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(type, baseFbxObjPromise) {
|
|
54
|
-
var treasureMapItem, _texture, fbxGroup, box2Mesh, texture;
|
|
55
|
-
|
|
56
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
57
|
-
while (1) {
|
|
58
|
-
switch (_context2.prev = _context2.next) {
|
|
59
|
-
case 0:
|
|
60
|
-
treasureMapItem = _treasureDataMap.treasureDataMap.get(type);
|
|
61
|
-
|
|
62
|
-
if (treasureMapItem) {
|
|
63
|
-
_context2.next = 3;
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
throw new Error('不存在的宝箱类型');
|
|
68
|
-
|
|
69
|
-
case 3:
|
|
70
|
-
if (!(treasureMapItem.type !== _constants.DEFAULT_TREASURE_TYPE)) {
|
|
71
|
-
_context2.next = 8;
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
_context2.next = 6;
|
|
76
|
-
return (0, _loadTexture.loadTexture)(treasureMapItem.textureUrl);
|
|
77
|
-
|
|
78
|
-
case 6:
|
|
79
|
-
_texture = _context2.sent;
|
|
80
|
-
return _context2.abrupt("return", {
|
|
81
|
-
treasureMapItem: treasureMapItem,
|
|
82
|
-
texture: _texture
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
case 8:
|
|
86
|
-
_context2.next = 10;
|
|
87
|
-
return baseFbxObjPromise;
|
|
88
|
-
|
|
89
|
-
case 10:
|
|
90
|
-
fbxGroup = _context2.sent;
|
|
91
|
-
box2Mesh = fbxGroup.getObjectByName('box2');
|
|
92
|
-
texture = box2Mesh === null || box2Mesh === void 0 ? void 0 : box2Mesh.material.map;
|
|
93
|
-
|
|
94
|
-
if (texture) {
|
|
95
|
-
_context2.next = 15;
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
throw new Error('加载内置资源失败: FBX 文件不存在 box2');
|
|
100
|
-
|
|
101
|
-
case 15:
|
|
102
|
-
return _context2.abrupt("return", {
|
|
103
|
-
treasureMapItem: treasureMapItem,
|
|
104
|
-
texture: texture
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
case 16:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context2.stop();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, _callee2);
|
|
113
|
-
}));
|
|
114
|
-
return _loadTreasureTextureWithType.apply(this, arguments);
|
|
115
|
-
}
|