Commit 64d70ef7 authored by wildfirecode's avatar wildfirecode

1

parent a3945893
...@@ -18,6 +18,14 @@ ...@@ -18,6 +18,14 @@
{ {
"script": "components/base/Transform", "script": "components/base/Transform",
"properties": {} "properties": {}
},
{
"script": "./scripts/scenes/BallItem",
"properties": {}
},
{
"script": "./scripts/scenes/BallItem",
"properties": {}
} }
], ],
"children": [ "children": [
......
...@@ -3,10 +3,10 @@ import ScillaComponent from 'components/base/ScillaComponent'; ...@@ -3,10 +3,10 @@ import ScillaComponent from 'components/base/ScillaComponent';
import { Transform } from 'scilla-components/src'; import { Transform } from 'scilla-components/src';
export default class BallItem extends ScillaComponent { export default class BallItem extends ScillaComponent {
speed = 0; private _speed = 0;
onUpdate() { onUpdate() {
const { entity } = this; const { entity } = this;
this.speed += 1.5; this._speed += 1.5;
entity.getComponent(Transform).position.y += this.speed; entity.getComponent(Transform).position.y += this._speed;
} }
} }
\ No newline at end of file
...@@ -159,6 +159,11 @@ ...@@ -159,6 +159,11 @@
} }
return arr.join('&'); return arr.join('&');
} }
function waitPromise(duration) {
return new Promise(function (resolve) {
setTimeout(resolve, duration);
});
}
var EngineConfig = { var EngineConfig = {
lineHeightRatio: 1.2, lineHeightRatio: 1.2,
...@@ -2158,13 +2163,15 @@ ...@@ -2158,13 +2163,15 @@
touchEnabled: true, touchEnabled: true,
}; };
var customConfig = {}; var customConfig = {};
var dataCenterConfig = {};
var root; var root;
var _flush = 0, _currentFlush = 0; var _flush = 0, _currentFlush = 0;
var tsStart; var tsStart;
var renderContext, interactContext; var renderContext, interactContext;
function setup(_engineConfig, _customConfig) { function setup(_engineConfig, _customConfig, _dataCenterConfig) {
injectProp(engineConfig, _engineConfig); injectProp(engineConfig, _engineConfig);
injectProp(customConfig, _customConfig); injectProp(customConfig, _customConfig);
injectProp(dataCenterConfig, _dataCenterConfig);
var canvas = engineConfig.canvas, designWidth = engineConfig.designWidth, designHeight = engineConfig.designHeight, scaleMode = engineConfig.scaleMode, modifyCanvasSize = engineConfig.modifyCanvasSize, touchEnabled = engineConfig.touchEnabled; var canvas = engineConfig.canvas, designWidth = engineConfig.designWidth, designHeight = engineConfig.designHeight, scaleMode = engineConfig.scaleMode, modifyCanvasSize = engineConfig.modifyCanvasSize, touchEnabled = engineConfig.touchEnabled;
var canvasElement = typeof canvas == 'object' ? canvas : document.getElementById(canvas); var canvasElement = typeof canvas == 'object' ? canvas : document.getElementById(canvas);
interactContext = setupContext({ interactContext = setupContext({
...@@ -2264,421 +2271,85 @@ ...@@ -2264,421 +2271,85 @@
}); });
} }
var entityCache = {}; var all = {};
var entityCacheConfig; function getGroup(name) {
var defMap = {}; var group = all[name];
var prefabID = 0; if (!group) {
function registerDef(name, def) { throw new Error('group ' + name + ' not registered.');
defMap[name] = def;
def.__class__ = name;
}
function getEntityCacheConfig(config) {
return config['entity-cache'] ? config['entity-cache'].concat() : [];
}
function setupScene(scene, root) {
scene.root = root;
var config = scene.config;
entityCacheConfig = getEntityCacheConfig(config);
instantiateConfig(config.root, root);
entityCache = {};
return scene;
}
function cleanEntity(entity) {
entity.removeAllComponents();
entity.removeChildren();
}
function instantiate(config) {
var pid = ++prefabID;
entityCacheConfig = getEntityCacheConfig(config);
for (var i = 0, li = entityCacheConfig.length; i < li; i++) {
entityCacheConfig[i] = pid + '_' + entityCacheConfig[i];
}
var rootConfig = config.root;
var entity = setupEntity(rootConfig, null, pid);
setupComponent(rootConfig, entity, true);
injectComponent(rootConfig, entity, true, pid);
entityCache = {};
return entity.children[0];
}
function instantiateConfig(config, root) {
var entity = setupEntity(config, root);
setupComponent(config, entity, true);
injectComponent(config, entity, true);
return entity;
}
function setupEntity(config, root, pid) {
var entity = null;
if (config) {
var name_1 = config.name, uuid = config.uuid, children = config.children;
if (pid !== undefined && uuid !== undefined) {
uuid = pid + '_' + uuid;
}
entity = root || new Entity(name_1, uuid);
if (entityCacheConfig.indexOf(uuid) >= 0) {
entityCache[uuid] = entity;
}
if (children) {
for (var i = 0, li = children.length; i < li; i++) {
var child = children[i];
var childEntity = setupEntity(child, null, pid);
entity.addChild(childEntity);
}
}
if (!root) {
entity.enabled = !config.disabled;
}
}
return entity;
}
function setupComponent(config, root, includeSelf) {
if (includeSelf === void 0) { includeSelf = false; }
if (includeSelf) {
instantiateComponents(root, config);
}
if (config && config.children) {
for (var i = 0, li = root.children.length; i < li; i++) {
var child = config.children[i];
var entity = root.children[i];
instantiateComponents(entity, child);
setupComponent(child, entity);
}
}
}
function injectComponent(config, root, includeSelf, pid) {
if (includeSelf === void 0) { includeSelf = false; }
if (includeSelf) {
injectComponents(root, config, pid);
}
if (config && config.children) {
for (var i = 0, li = root.children.length; i < li; i++) {
var child = config.children[i];
var entity = root.children[i];
injectComponents(entity, child, pid);
injectComponent(child, entity, false, pid);
}
}
}
function instantiateComponents(entity, config) {
var e_1, _a;
if (config.components) {
try {
for (var _b = __values(config.components), _c = _b.next(); !_c.done; _c = _b.next()) {
var component = _c.value;
instantiateComponent(entity, component);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
}
}
function injectComponents(entity, config, pid) {
if (config.components) {
var components = entity.components;
for (var i = 0, li = config.components.length; i < li; i++) {
var component = config.components[i];
injectComponentProperties(components[i], component, pid);
}
}
}
function injectComponentProperties(component, config, pid) {
var properties = config.properties;
if (properties) {
injectProperties(component, properties, pid);
}
}
function instantiateComponent(entity, config) {
var script = config.script;
var def = getDefByName(script);
if (!def) {
return;
}
var instance = new def();
instance.enabled = !config.disabled;
entity.addComponent(instance);
return instance;
}
function getDefByName(name, showWarn) {
if (showWarn === void 0) { showWarn = true; }
var def;
def = defMap[name];
if (!def && showWarn) {
console.warn('missing def:', name);
return;
}
return def;
}
var skipKeys = ['_type_', '_constructor_'];
function injectProperties(node, propertiesConfig, pid) {
if (!node) {
console.warn('node is null.');
return;
}
for (var key in propertiesConfig) {
if (skipKeys.indexOf(key) >= 0) {
continue;
}
var propertyOfConfig = propertiesConfig[key];
var propertyOfInstance = node[key];
if (typeof propertyOfConfig === 'object') {
if (propertyOfInstance instanceof ScillaEvent) {
if (!EngineConfig.editorMode) {
injectEvent(propertyOfInstance, propertyOfConfig, pid);
}
} }
else if (propertyOfConfig._type_ === 'raw') { return group;
node[key] = propertyOfInstance = propertyOfConfig.data;
} }
else { function register(name, newFunc, initFunc) {
if (Array.isArray(propertyOfConfig) && !propertyOfInstance) { all[name] = { name: name, newFunc: newFunc, initFunc: initFunc, pool: [] };
node[key] = propertyOfInstance = [];
} }
node[key] = injectObject(propertyOfInstance, propertyOfConfig, pid); function get(name) {
var params = [];
for (var _i = 1; _i < arguments.length; _i++) {
params[_i - 1] = arguments[_i];
} }
var group = getGroup(name);
var newFunc = group.newFunc, initFunc = group.initFunc, pool = group.pool;
var instance;
if (pool.length == 0) {
instance = newFunc();
} }
else { else {
injectBaseType(node, key, propertyOfConfig, pid); instance = pool.pop();
}
}
} }
function injectObject(propertyOfInstance, propertyOfConfig, pid) { initFunc.apply(void 0, __spread([instance], params));
if (propertyOfInstance === undefined) { return instance;
if (propertyOfConfig._type_) {
var def = getDefByName(propertyOfConfig._type_);
if (def) {
var constructorArgs = propertyOfConfig._constructor_;
if (constructorArgs && constructorArgs.length > 0) {
propertyOfInstance = def.constructor.apply(null, constructorArgs);
} }
else {
propertyOfInstance = new def(); var name = 'Vector2D';
register(name, function () {
return new Vector2D();
}, function (instance, x, y) {
instance.setXY(x, y);
});
function createVector2D(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
return get(name, x, y);
} }
var Vector2D = (function () {
function Vector2D(x, y, onChange) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
this.onChange = onChange;
this._x = 0;
this._y = 0;
this.setXY(x, y);
} }
Object.defineProperty(Vector2D, "zero", {
get: function () {
return zero;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Vector2D.prototype, "x", {
get: function () {
return this._x;
},
set: function (v) {
if (this._x !== v) {
var old = this._x;
this._x = v;
this.onChange && this.onChange(v, 'x', old);
} }
} },
if (propertyOfInstance) { enumerable: true,
injectProperties(propertyOfInstance, propertyOfConfig, pid); configurable: true
} });
return propertyOfInstance; Object.defineProperty(Vector2D.prototype, "y", {
} get: function () {
function injectBaseType(node, key, propertyOfConfig, pid) { return this._y;
var propertyValue; },
if (typeof propertyOfConfig === 'string') { set: function (v) {
propertyValue = getLink(propertyOfConfig, pid); if (this._y !== v) {
} var old = this._y;
else { this._y = v;
propertyValue = propertyOfConfig; this.onChange && this.onChange(v, 'y', old);
}
var keyAvatar = key;
if (propertyValue instanceof Promise) {
keyAvatar = 'async_' + keyAvatar;
}
node[keyAvatar] = propertyValue;
}
function injectEvent(event, config, pid) {
var e_2, _a;
try {
for (var config_1 = __values(config), config_1_1 = config_1.next(); !config_1_1.done; config_1_1 = config_1.next()) {
var _b = config_1_1.value, entityName = _b.entity, componentIndex = _b.component, methodName = _b.method, param = _b.param;
if (entityName && componentIndex >= 0 && methodName) {
var entity = getLink(entityName, pid);
var component = entity.components[componentIndex];
var method = component[methodName];
if (method) {
if (param == undefined) {
event.addListener(method, component, 0);
}
else {
event.addListener(method, component, 0, param);
}
}
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (config_1_1 && !config_1_1.done && (_a = config_1.return)) _a.call(config_1);
}
finally { if (e_2) throw e_2.error; }
}
}
function getLink(str, pid) {
var result;
if (str.indexOf('res|') == 0) {
var uuid = str.substr(4);
result = getRes(uuid);
}
else if (str.indexOf('entity|') == 0) {
var uuid = transPrefabUUID(str.substr(7), pid);
result = entityCache[uuid];
}
else {
result = str;
}
return result;
}
function transPrefabUUID(uuid, pid) {
return pid ? pid + '_' + uuid : uuid;
}
var currentScene;
var resUUIDs;
function launchScene(sceneNameOrPath, progress) {
return __awaiter(this, void 0, void 0, function () {
var sceneConfig, sceneFile, scene;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
sceneConfig = customConfig.scene;
sceneFile = sceneConfig.scenes[sceneNameOrPath];
if (!sceneFile) {
sceneFile = sceneNameOrPath;
}
return [4, loadScene(sceneFile, 'scene_' + sceneFile)];
case 1:
scene = _a.sent();
resUUIDs = getAllResUuids();
return [4, scene.loadResGroup('preload', progress)];
case 2:
_a.sent();
if (currentScene) {
unmountScene(currentScene);
}
currentScene = scene;
mountScene(scene);
scene.loadResGroup('delay', progress);
return [2];
}
});
});
}
function mountScene(scene) {
pause();
setupScene(scene, getRoot());
start();
}
function unmountScene(scene) {
pause();
cleanEntity(scene.root);
destroyRes(resUUIDs);
}
function loadScene(url, uuid, cache, config) {
if (cache === void 0) { cache = false; }
return __awaiter(this, void 0, void 0, function () {
var sceneConfig, scene;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, loadJson5(url)];
case 1:
sceneConfig = _a.sent();
scene = new Scene();
scene.initByConfig(sceneConfig);
return [2, scene];
}
});
});
}
function loadPrefab(url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
var data;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, loadJson5(url, uuid, false)];
case 1:
data = _a.sent();
cacheRes(data, url, uuid);
return [2, data];
}
});
});
}
addLoader('.pfb', loadPrefab);
var all = {};
function getGroup(name) {
var group = all[name];
if (!group) {
throw new Error('group ' + name + ' not registered.');
}
return group;
}
function register(name, newFunc, initFunc) {
all[name] = { name: name, newFunc: newFunc, initFunc: initFunc, pool: [] };
}
function get(name) {
var params = [];
for (var _i = 1; _i < arguments.length; _i++) {
params[_i - 1] = arguments[_i];
}
var group = getGroup(name);
var newFunc = group.newFunc, initFunc = group.initFunc, pool = group.pool;
var instance;
if (pool.length == 0) {
instance = newFunc();
}
else {
instance = pool.pop();
}
initFunc.apply(void 0, __spread([instance], params));
return instance;
}
var name = 'Vector2D';
register(name, function () {
return new Vector2D();
}, function (instance, x, y) {
instance.setXY(x, y);
});
function createVector2D(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
return get(name, x, y);
}
var Vector2D = (function () {
function Vector2D(x, y, onChange) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
this.onChange = onChange;
this._x = 0;
this._y = 0;
this.setXY(x, y);
}
Object.defineProperty(Vector2D, "zero", {
get: function () {
return zero;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Vector2D.prototype, "x", {
get: function () {
return this._x;
},
set: function (v) {
if (this._x !== v) {
var old = this._x;
this._x = v;
this.onChange && this.onChange(v, 'x', old);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Vector2D.prototype, "y", {
get: function () {
return this._y;
},
set: function (v) {
if (this._y !== v) {
var old = this._y;
this._y = v;
this.onChange && this.onChange(v, 'y', old);
} }
}, },
enumerable: true, enumerable: true,
...@@ -2844,14 +2515,14 @@ ...@@ -2844,14 +2515,14 @@
var distance = Math.abs(end - begin); var distance = Math.abs(end - begin);
return begin + distance * t * sign; return begin + distance * t * sign;
} }
function lerpObj(begin, end, t, clazz, fields, allowOutOfBounds) { function lerpObj(begin, end, t, fields, allowOutOfBounds) {
if (allowOutOfBounds === void 0) { allowOutOfBounds = false; } if (allowOutOfBounds === void 0) { allowOutOfBounds = false; }
var e_1, _a; var e_1, _a;
var type = typeof begin; var type = typeof begin;
if (type !== typeof end) { if (type !== typeof end) {
console.error('begin and end need same type'); console.error('begin and end need same type');
} }
var temp = new clazz(); var temp = {};
try { try {
for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) { for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) {
var field = fields_1_1.value; var field = fields_1_1.value;
...@@ -2930,7 +2601,7 @@ ...@@ -2930,7 +2601,7 @@
_this.t = t; _this.t = t;
switch (_this.status) { switch (_this.status) {
case STATUS.DO_TO: case STATUS.DO_TO:
var _a = _this, target = _a.target, startTime = _a.startTime, fromProps = _a.fromProps, toProps = _a.toProps, duration = _a.duration, ease = _a.ease, clazz = _a.clazz, fields = _a.fields; var _a = _this, target = _a.target, startTime = _a.startTime, fromProps = _a.fromProps, toProps = _a.toProps, duration = _a.duration, ease = _a.ease;
var passTime = t - startTime; var passTime = t - startTime;
var timeRatio = Math.min(1, passTime / duration); var timeRatio = Math.min(1, passTime / duration);
var ratio = timeRatio; var ratio = timeRatio;
...@@ -2942,18 +2613,18 @@ ...@@ -2942,18 +2613,18 @@
var fromValue = fromProps[key]; var fromValue = fromProps[key];
var currentValue = void 0; var currentValue = void 0;
if (timeRatio < 1) { if (timeRatio < 1) {
if (typeof toValue == 'object') { currentValue = _this.resolveLerp(fromValue, toValue, ratio);
currentValue = lerpObj(fromValue, toValue, ratio, clazz, fields || Object.keys(toValue), true);
} }
else { else {
currentValue = lerp(fromValue, toValue, ratio, true); currentValue = toValue;
} }
if (typeof currentValue === 'string') {
injectProp(target[key], currentValue);
} }
else { else {
currentValue = toValue;
}
target[key] = currentValue; target[key] = currentValue;
} }
}
if (timeRatio >= 1) { if (timeRatio >= 1) {
_this._doNextAction(); _this._doNextAction();
} }
...@@ -3014,7 +2685,6 @@ ...@@ -3014,7 +2685,6 @@
_this.target = target; _this.target = target;
_this.loop = options ? options.loop : 0; _this.loop = options ? options.loop : 0;
_this.autoPlay = options ? (options.hasOwnProperty('autoPlay') ? options.autoPlay : true) : true; _this.autoPlay = options ? (options.hasOwnProperty('autoPlay') ? options.autoPlay : true) : true;
_this.clazz = options ? options.clazz : null;
_this.fields = options ? options.fields : null; _this.fields = options ? options.fields : null;
_this.plugins = plugins; _this.plugins = plugins;
if (options && options.initFields && options.initFields.length > 0) { if (options && options.initFields && options.initFields.length > 0) {
...@@ -3022,8 +2692,37 @@ ...@@ -3022,8 +2692,37 @@
} }
return _this; return _this;
} }
Tween.prototype.getInitProps = function (fields) { Tween.prototype.resolveLerp = function (fromValue, toValue, ratio) {
var e_2, _a; var e_2, _a;
var currentValue;
if (this.plugins.length > 0) {
try {
for (var _b = __values(this.plugins), _c = _b.next(); !_c.done; _c = _b.next()) {
var plugin = _c.value;
currentValue = plugin.resolveLerp(fromValue, toValue, ratio, true);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
}
else {
if (typeof toValue == 'object') {
var fields = this.fields;
currentValue = lerpObj(fromValue, toValue, ratio, fields || Object.keys(toValue), true);
}
else {
currentValue = lerp(fromValue, toValue, ratio, true);
}
}
return currentValue;
};
Tween.prototype.getInitProps = function (fields) {
var e_3, _a;
var props = {}; var props = {};
try { try {
for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) { for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) {
...@@ -3033,12 +2732,12 @@ ...@@ -3033,12 +2732,12 @@
} }
} }
} }
catch (e_2_1) { e_2 = { error: e_2_1 }; } catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally { finally {
try { try {
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1); if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
} }
finally { if (e_2) throw e_2.error; } finally { if (e_3) throw e_3.error; }
} }
return props; return props;
}; };
...@@ -3771,12 +3470,406 @@ ...@@ -3771,12 +3470,406 @@
return EventEmitter; return EventEmitter;
}()); }());
var Ease; var dataCenter;
(function (Ease) { var DataCenter = (function () {
Ease["quadIn"] = "quadIn"; function DataCenter() {
Ease["quadOut"] = "quadOut"; if (dataCenter)
Ease["quadInOut"] = "quadInOut"; return dataCenter;
Ease["cubicIn"] = "cubicIn"; }
DataCenter.ins = function () {
return dataCenter;
};
DataCenter.prototype.register = function (type) {
this[type] = this[type] || {};
};
DataCenter.prototype.set = function (type, key, value) {
this.register(type);
if (!value) {
if (this[type])
console.warn("This operation will overridee all " + this[type]);
this[type] = key;
}
else {
this[type][key] = value;
}
};
DataCenter.prototype.get = function (type, key) {
if (!key)
return this[type];
return this[type][key];
};
DataCenter.prototype.use = function (type, key) {
var _this = this;
return function (resopnse) {
_this.set(type, key, resopnse);
return resopnse;
};
};
DataCenter.prototype.parse = function (type, expression) {
this.register(type);
return eval("(this['" + type + "']." + expression + ")");
};
return DataCenter;
}());
dataCenter = new DataCenter();
var dataCenter$1 = dataCenter;
var entityCache = {};
var entityCacheConfig;
var defMap = {};
var prefabID = 0;
function registerDef(name, def) {
defMap[name] = def;
def.__class__ = name;
}
function getEntityCacheConfig(config) {
return config['entity-cache'] ? config['entity-cache'].concat() : [];
}
function setupScene(scene, root) {
scene.root = root;
var config = scene.config;
entityCacheConfig = getEntityCacheConfig(config);
instantiateConfig(config.root, root);
entityCache = {};
return scene;
}
function cleanEntity(entity) {
entity.removeAllComponents();
entity.removeChildren();
}
function instantiate(config) {
var pid = ++prefabID;
entityCacheConfig = getEntityCacheConfig(config);
for (var i = 0, li = entityCacheConfig.length; i < li; i++) {
entityCacheConfig[i] = pid + '_' + entityCacheConfig[i];
}
var rootConfig = config.root;
var entity = setupEntity(rootConfig, null, pid);
setupComponent(rootConfig, entity, true);
injectComponent(rootConfig, entity, true, pid);
entityCache = {};
return entity.children[0];
}
function instantiateConfig(config, root) {
var entity = setupEntity(config, root);
setupComponent(config, entity, true);
injectComponent(config, entity, true);
return entity;
}
function setupEntity(config, root, pid) {
var entity = null;
if (config) {
var name_1 = config.name, uuid = config.uuid, children = config.children;
if (pid !== undefined && uuid !== undefined) {
uuid = pid + '_' + uuid;
}
entity = root || new Entity(name_1, uuid);
if (entityCacheConfig.indexOf(uuid) >= 0) {
entityCache[uuid] = entity;
}
if (children) {
for (var i = 0, li = children.length; i < li; i++) {
var child = children[i];
var childEntity = setupEntity(child, null, pid);
entity.addChild(childEntity);
}
}
if (!root) {
entity.enabled = !config.disabled;
}
}
return entity;
}
function setupComponent(config, root, includeSelf) {
if (includeSelf === void 0) { includeSelf = false; }
if (includeSelf) {
instantiateComponents(root, config);
}
if (config && config.children) {
for (var i = 0, li = root.children.length; i < li; i++) {
var child = config.children[i];
var entity = root.children[i];
instantiateComponents(entity, child);
setupComponent(child, entity);
}
}
}
function injectComponent(config, root, includeSelf, pid) {
if (includeSelf === void 0) { includeSelf = false; }
if (includeSelf) {
injectComponents(root, config, pid);
}
if (config && config.children) {
for (var i = 0, li = root.children.length; i < li; i++) {
var child = config.children[i];
var entity = root.children[i];
injectComponents(entity, child, pid);
injectComponent(child, entity, false, pid);
}
}
}
function instantiateComponents(entity, config) {
var e_1, _a;
if (config.components) {
try {
for (var _b = __values(config.components), _c = _b.next(); !_c.done; _c = _b.next()) {
var component = _c.value;
instantiateComponent(entity, component);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
}
}
function injectComponents(entity, config, pid) {
if (config.components) {
var components = entity.components;
for (var i = 0, li = config.components.length; i < li; i++) {
var component = config.components[i];
injectComponentProperties(components[i], component, pid);
}
}
}
function injectComponentProperties(component, config, pid) {
var properties = config.properties;
if (properties) {
injectProperties(component, properties, pid);
}
}
function instantiateComponent(entity, config) {
var script = config.script;
var def = getDefByName(script);
if (!def) {
return;
}
var instance = new def();
instance.enabled = !config.disabled;
entity.addComponent(instance);
return instance;
}
function getDefByName(name, showWarn) {
if (showWarn === void 0) { showWarn = true; }
var def;
def = defMap[name];
if (!def && showWarn) {
console.warn('missing def:', name);
return;
}
return def;
}
var skipKeys = ['_type_', '_constructor_'];
function injectProperties(node, propertiesConfig, pid) {
if (!node) {
console.warn('node is null.');
return;
}
for (var key in propertiesConfig) {
if (skipKeys.indexOf(key) >= 0) {
continue;
}
var propertyOfConfig = propertiesConfig[key];
var propertyOfInstance = node[key];
if (typeof propertyOfConfig === 'object') {
if (propertyOfInstance instanceof ScillaEvent) {
if (!EngineConfig.editorMode) {
injectEvent(propertyOfInstance, propertyOfConfig, pid);
}
}
else if (propertyOfConfig._type_ === 'raw') {
node[key] = propertyOfInstance = propertyOfConfig.data;
}
else {
if (Array.isArray(propertyOfConfig) && !propertyOfInstance) {
node[key] = propertyOfInstance = [];
}
node[key] = injectObject(propertyOfInstance, propertyOfConfig, pid);
}
}
else {
injectBaseType(node, key, propertyOfConfig, pid);
}
}
}
function injectObject(propertyOfInstance, propertyOfConfig, pid) {
if (propertyOfInstance === undefined) {
if (propertyOfConfig._type_) {
var def = getDefByName(propertyOfConfig._type_);
if (def) {
var constructorArgs = propertyOfConfig._constructor_;
if (constructorArgs && constructorArgs.length > 0) {
propertyOfInstance = def.constructor.apply(null, constructorArgs);
}
else {
propertyOfInstance = new def();
}
}
}
}
if (propertyOfInstance) {
injectProperties(propertyOfInstance, propertyOfConfig, pid);
}
return propertyOfInstance;
}
function injectBaseType(node, key, propertyOfConfig, pid) {
var propertyValue;
if (typeof propertyOfConfig === 'string') {
propertyValue = getLink(propertyOfConfig, pid);
}
else {
propertyValue = propertyOfConfig;
}
var keyAvatar = key;
if (propertyValue instanceof Promise) {
keyAvatar = 'async_' + keyAvatar;
}
if (typeof propertyValue === 'function') {
Object.defineProperty(node, keyAvatar, {
get: function () {
return this["func_" + keyAvatar]();
},
set: function (v) {
this["func_" + keyAvatar] = v;
}
});
}
node[keyAvatar] = propertyValue;
}
function injectEvent(event, config, pid) {
var e_2, _a;
try {
for (var config_1 = __values(config), config_1_1 = config_1.next(); !config_1_1.done; config_1_1 = config_1.next()) {
var _b = config_1_1.value, entityName = _b.entity, componentIndex = _b.component, methodName = _b.method, param = _b.param;
if (entityName && componentIndex >= 0 && methodName) {
var entity = getLink(entityName, pid);
var component = entity.components[componentIndex];
var method = component[methodName];
if (method) {
if (param == undefined) {
event.addListener(method, component, 0);
}
else {
event.addListener(method, component, 0, param);
}
}
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (config_1_1 && !config_1_1.done && (_a = config_1.return)) _a.call(config_1);
}
finally { if (e_2) throw e_2.error; }
}
}
function getLink(str, pid) {
var result;
if (str.indexOf('res|') == 0) {
var uuid = str.substr(4);
result = getRes(uuid);
}
else if (str.indexOf('entity|') == 0) {
var uuid = transPrefabUUID(str.substr(7), pid);
result = entityCache[uuid];
}
else if (str.indexOf('dynamic|') == 0) {
var _a = __read(str.split('|'), 3), _ = _a[0], type_1 = _a[1], expression_1 = _a[2];
result = function () { return dataCenter$1.parse(type_1, expression_1); };
}
else {
result = str;
}
return result;
}
function transPrefabUUID(uuid, pid) {
return pid ? pid + '_' + uuid : uuid;
}
var currentScene;
var resUUIDs;
function launchScene(sceneNameOrPath, progress) {
return __awaiter(this, void 0, void 0, function () {
var sceneConfig, sceneFile, scene;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
sceneConfig = customConfig.scene;
sceneFile = sceneConfig.scenes[sceneNameOrPath];
if (!sceneFile) {
sceneFile = sceneNameOrPath;
}
return [4, loadScene(sceneFile, 'scene_' + sceneFile)];
case 1:
scene = _a.sent();
resUUIDs = getAllResUuids();
return [4, scene.loadResGroup('preload', progress)];
case 2:
_a.sent();
if (currentScene) {
unmountScene(currentScene);
}
currentScene = scene;
mountScene(scene);
scene.loadResGroup('delay', progress);
return [2];
}
});
});
}
function mountScene(scene) {
pause();
setupScene(scene, getRoot());
start();
}
function unmountScene(scene) {
pause();
cleanEntity(scene.root);
destroyRes(resUUIDs);
}
function loadScene(url, uuid, cache, config) {
if (cache === void 0) { cache = false; }
return __awaiter(this, void 0, void 0, function () {
var sceneConfig, scene;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, loadJson5(url)];
case 1:
sceneConfig = _a.sent();
scene = new Scene();
scene.initByConfig(sceneConfig);
return [2, scene];
}
});
});
}
function loadPrefab(url, uuid, cache, config) {
if (cache === void 0) { cache = true; }
return __awaiter(this, void 0, void 0, function () {
var data;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, loadJson5(url, uuid, false)];
case 1:
data = _a.sent();
cacheRes(data, url, uuid);
return [2, data];
}
});
});
}
addLoader('.pfb', loadPrefab);
var Ease;
(function (Ease) {
Ease["quadIn"] = "quadIn";
Ease["quadOut"] = "quadOut";
Ease["quadInOut"] = "quadInOut";
Ease["cubicIn"] = "cubicIn";
Ease["cubicOut"] = "cubicOut"; Ease["cubicOut"] = "cubicOut";
Ease["cubicInOut"] = "cubicInOut"; Ease["cubicInOut"] = "cubicInOut";
Ease["quartIn"] = "quartIn"; Ease["quartIn"] = "quartIn";
...@@ -5403,7 +5496,6 @@ ...@@ -5403,7 +5496,6 @@
var newScale = maxScale - length * maxScale / 2048; var newScale = maxScale - length * maxScale / 2048;
scale.setXY(newScale, newScale); scale.setXY(newScale, newScale);
this.followPosition.setXY(width / 2, height / 2).subtract(this.targetPosition); this.followPosition.setXY(width / 2, height / 2).subtract(this.targetPosition);
position.copyFrom(lerpObj(position, this.followPosition, 0.1, Vector2D, ['x', 'y']));
}; };
return CameraController; return CameraController;
}(ScillaComponent)); }(ScillaComponent));
...@@ -5424,9 +5516,9 @@ ...@@ -5424,9 +5516,9 @@
var easeFunc = ease[this.easeName]; var easeFunc = ease[this.easeName];
var scaleFrom = transform.scale.clone(); var scaleFrom = transform.scale.clone();
var scaleTo = transform.scale.clone().add(scaleOffset); var scaleTo = transform.scale.clone().add(scaleOffset);
this._zoomIn = createTween(this, transform, false, { autoPlay: false, clazz: Vector2D, fields: ['x', 'y'] }) this._zoomIn = createTween(this, transform, false, { autoPlay: false, fields: ['x', 'y'] })
.to({ scale: scaleTo }, duration, easeFunc); .to({ scale: scaleTo }, duration, easeFunc);
this._zoomOut = createTween(this, transform, false, { autoPlay: false, clazz: Vector2D, fields: ['x', 'y'] }) this._zoomOut = createTween(this, transform, false, { autoPlay: false, fields: ['x', 'y'] })
.to({ scale: scaleFrom }, duration, easeFunc); .to({ scale: scaleFrom }, duration, easeFunc);
} }
}; };
...@@ -5709,7 +5801,7 @@ ...@@ -5709,7 +5801,7 @@
} }
BounceZoom.prototype.onAwake = function () { BounceZoom.prototype.onAwake = function () {
_super.prototype.onAwake.call(this); _super.prototype.onAwake.call(this);
this._tween = createTween(this, this.transform, false, { clazz: Vector2D, fields: ['x', 'y'], autoPlay: false }) this._tween = createTween(this, this.transform, false, { fields: ['x', 'y'], autoPlay: false })
.to({ scale: this.targetScale.clone() }, this.duration * 0.5) .to({ scale: this.targetScale.clone() }, this.duration * 0.5)
.to({ scale: originScale.clone() }, this.duration * 0.5); .to({ scale: originScale.clone() }, this.duration * 0.5);
}; };
...@@ -6165,7 +6257,7 @@ ...@@ -6165,7 +6257,7 @@
var ty = Math.min(Math.max(offY + rHeight, y), offY); var ty = Math.min(Math.max(offY + rHeight, y), offY);
var targetPos = createVector2D(tx, ty); var targetPos = createVector2D(tx, ty);
var duration = Math.min(500, Math.max(targetPos.distance(position), 200)); var duration = Math.min(500, Math.max(targetPos.distance(position), 200));
createTween(this, this._contentTransform, true, { clazz: Vector2D, fields: ['x', 'y'] }) createTween(this, this._contentTransform, true, { fields: ['x', 'y'] })
.to({ position: targetPos }, duration, cubicOut); .to({ position: targetPos }, duration, cubicOut);
}; };
return ScrollView; return ScrollView;
...@@ -6231,7 +6323,7 @@ ...@@ -6231,7 +6323,7 @@
return ApiComponent; return ApiComponent;
}(ScillaComponent)); }(ScillaComponent));
function callApi(uri, params, method, responseType, ignoreSuccessField) { function callApi(name, uri, params, method, responseType, ignoreSuccessField) {
if (params === void 0) { params = null; } if (params === void 0) { params = null; }
if (method === void 0) { method = 'post'; } if (method === void 0) { method = 'post'; }
if (responseType === void 0) { responseType = 'json'; } if (responseType === void 0) { responseType = 'json'; }
...@@ -6281,36 +6373,233 @@ ...@@ -6281,36 +6373,233 @@
console.log('decode json failed: ' + url); console.log('decode json failed: ' + url);
return Promise.reject({}); return Promise.reject({});
} }
if (ignoreSuccessField || data.success) { if (ignoreSuccessField || data.success) {
return { return {
data: data.hasOwnProperty('data') ? data.data : data, data: data.hasOwnProperty('data') ? data.data : data,
origin: data, origin: data,
};
}
else {
return Promise.reject(data.code);
}
case 'html':
var html = null;
return html;
case 'txt':
return response;
}
}
return Promise.reject();
})
.then(function (response) {
dataCenter$1.set(dataCenterConfig.ajax, name, response.origin);
return response;
});
}
function polling(name, successFunc, uri, params, maxTimes, delay, method, responseType) {
if (maxTimes === void 0) { maxTimes = 10; }
if (delay === void 0) { delay = 500; }
if (method === void 0) { method = 'POST'; }
if (responseType === void 0) { responseType = 'json'; }
var p = Promise.resolve();
for (var i = 0; i < maxTimes; i++) {
p = p.then(func);
p = p.then(function () {
return waitPromise(delay);
});
}
var lastData;
return p.then(function () {
return Promise.reject(null);
}, function (e) {
if (e === 'success') {
return Promise.resolve(lastData);
}
return Promise.reject(e);
});
function func() {
return callApi(name, uri, params, method, responseType).then(function (data) {
if (successFunc(data)) {
lastData = data;
return Promise.reject('success');
}
}, function (e) {
return Promise.reject(e);
});
}
}
var SampleApi = (function (_super) {
__extends(SampleApi, _super);
function SampleApi() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.ignoreSuccessField = false;
_this.method = 'POST';
_this.params = {};
return _this;
}
SampleApi.prototype.callApi = function (name, paramsInput) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(this.name == name)) return [3, 2];
return [4, this.execute.apply(this, __spread([paramsInput], args))];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2];
}
});
});
}; };
SampleApi.prototype.execute = function (paramsInput) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
} }
else { return __awaiter(this, void 0, void 0, function () {
return Promise.reject(data.code); var params, _a, uri, method, name, response, e_1;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4, _super.prototype.execute.apply(this, __spread([paramsInput], args))];
case 1:
_b.sent();
params = {};
if (this.params) {
injectProp(params, this.params);
} }
case 'html': if (paramsInput) {
var html = null; injectProp(params, paramsInput);
return html;
case 'txt':
return response;
} }
_a = this, uri = _a.uri, method = _a.method, name = _a.name;
_b.label = 2;
case 2:
_b.trys.push([2, 4, , 5]);
return [4, callApi(name, uri, params, method, 'json', this.ignoreSuccessField)];
case 3:
response = _b.sent();
this.onGotResponse(response);
return [2, response.data];
case 4:
e_1 = _b.sent();
this.onGotError(e_1);
return [3, 5];
case 5: return [2];
} }
return Promise.reject();
}); });
});
};
return SampleApi;
}(ApiComponent));
var AjaxElementComponent = (function (_super) {
__extends(AjaxElementComponent, _super);
function AjaxElementComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'ajaxElement';
_this.uri = '/hdtool/recon/ajaxElement';
_this.method = 'GET';
return _this;
} }
AjaxElementComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { duibaId: this.duibaId, activityId: this.activityId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return AjaxElementComponent;
}(SampleApi));
var SampleApi = (function (_super) { var DoJoinComponent = (function (_super) {
__extends(SampleApi, _super); __extends(DoJoinComponent, _super);
function SampleApi() { function DoJoinComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this; var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'doJoin';
_this.uri = '/hdtool/recon/doJoin';
_this.method = 'GET';
return _this;
}
DoJoinComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, {
activityId: this.activityId, token: this.token, againOrderId: this.againOrderId,
activityType: this.activityType, consumerId: this.consumerId, credits: this.credits, score: this.score
});
_super.prototype.execute.call(this);
return [2];
});
});
};
return DoJoinComponent;
}(SampleApi));
var GetOrderStatusComponent = (function (_super) {
__extends(GetOrderStatusComponent, _super);
function GetOrderStatusComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'getOrderStatus';
_this.uri = '/hdtool/recon/getOrderStatus';
_this.method = 'POST'; _this.method = 'POST';
return _this;
}
GetOrderStatusComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return GetOrderStatusComponent;
}(SampleApi));
var PrizeDetailComponent = (function (_super) {
__extends(PrizeDetailComponent, _super);
function PrizeDetailComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'prizeDetail';
_this.uri = '/hdtool/recon/prizeDetail';
_this.method = 'GET';
return _this;
}
PrizeDetailComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { appItemId: this.appItemId, itemId: this.itemId, appId: this.appId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return PrizeDetailComponent;
}(SampleApi));
var SamplePollingApi = (function (_super) {
__extends(SamplePollingApi, _super);
function SamplePollingApi() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.method = 'GET';
_this.params = {}; _this.params = {};
_this.ignoreSuccessField = false; _this.maxTimes = 5;
_this.delay = 500;
_this.successFunc = function (response) {
var _a = _this, successField = _a.successField, successValues = _a.successValues;
var v = successField ? response.data[successField] : response.data;
return successValues.indexOf(v) >= 0;
};
return _this; return _this;
} }
SampleApi.prototype.callApi = function (name, paramsInput) { SamplePollingApi.prototype.callApi = function (name, paramsInput) {
var args = []; var args = [];
for (var _i = 2; _i < arguments.length; _i++) { for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i]; args[_i - 2] = arguments[_i];
...@@ -6329,13 +6618,13 @@ ...@@ -6329,13 +6618,13 @@
}); });
}); });
}; };
SampleApi.prototype.execute = function (paramsInput) { SamplePollingApi.prototype.execute = function (paramsInput) {
var args = []; var args = [];
for (var _i = 1; _i < arguments.length; _i++) { for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i]; args[_i - 1] = arguments[_i];
} }
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var params, _a, uri, method, response, e_1; var params, _a, uri, method, name, response, e_1;
return __generator(this, function (_b) { return __generator(this, function (_b) {
switch (_b.label) { switch (_b.label) {
case 0: return [4, _super.prototype.execute.apply(this, __spread([paramsInput], args))]; case 0: return [4, _super.prototype.execute.apply(this, __spread([paramsInput], args))];
...@@ -6348,11 +6637,11 @@ ...@@ -6348,11 +6637,11 @@
if (paramsInput) { if (paramsInput) {
injectProp(params, paramsInput); injectProp(params, paramsInput);
} }
_a = this, uri = _a.uri, method = _a.method; _a = this, uri = _a.uri, method = _a.method, name = _a.name;
_b.label = 2; _b.label = 2;
case 2: case 2:
_b.trys.push([2, 4, , 5]); _b.trys.push([2, 4, , 5]);
return [4, callApi(uri, params, method, 'json', this.ignoreSuccessField)]; return [4, polling(name, this.successFunc, uri, params, this.maxTimes, this.delay, method)];
case 3: case 3:
response = _b.sent(); response = _b.sent();
this.onGotResponse(response); this.onGotResponse(response);
...@@ -6366,9 +6655,309 @@ ...@@ -6366,9 +6655,309 @@
}); });
}); });
}; };
return SampleApi; return SamplePollingApi;
}(ApiComponent)); }(ApiComponent));
var SubCreditsStatusComponent = (function (_super) {
__extends(SubCreditsStatusComponent, _super);
function SubCreditsStatusComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'subCreditsStatus';
_this.uri = '/hdtool/recon/subCreditsStatus';
_this.method = 'POST';
return _this;
}
SubCreditsStatusComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return SubCreditsStatusComponent;
}(SamplePollingApi));
var DatapashComponent = (function (_super) {
__extends(DatapashComponent, _super);
function DatapashComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'datapash';
_this.uri = '/hdtool/recon/ngame/datapash';
_this.method = 'POST';
return _this;
}
DatapashComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId, duibaId: this.duibaId, dynamicData: this.dynamicData });
_super.prototype.execute.call(this);
return [2];
});
});
};
return DatapashComponent;
}(SampleApi));
var GetNgameStartStatusComponent = (function (_super) {
__extends(GetNgameStartStatusComponent, _super);
function GetNgameStartStatusComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'getNgameStartStatus';
_this.uri = '/hdtool/recon/ngame/getNgameStartStatus';
_this.method = 'POST';
return _this;
}
GetNgameStartStatusComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return GetNgameStartStatusComponent;
}(SamplePollingApi));
var NgameManySubmitComponent = (function (_super) {
__extends(NgameManySubmitComponent, _super);
function NgameManySubmitComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'ngameManySubmit';
_this.uri = '/hdtool/recon/ngame/ngameManySubmit';
_this.method = 'POST';
return _this;
}
NgameManySubmitComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, {
orderId: this.orderId, score: this.score, gameData: this.gameData, sgin: this.sgin,
dynamicData: this.dynamicData
});
_super.prototype.execute.call(this);
return [2];
});
});
};
return NgameManySubmitComponent;
}(SampleApi));
var NgameSubmitComponent = (function (_super) {
__extends(NgameSubmitComponent, _super);
function NgameSubmitComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'ngameSubmit';
_this.uri = '/hdtool/recon/ngame/ngameSubmit';
_this.method = 'POST';
return _this;
}
NgameSubmitComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, {
orderId: this.orderId, score: this.score, gameData: this.gameData, sgin: this.sgin,
dynamicData: this.dynamicData
});
_super.prototype.execute.call(this);
return [2];
});
});
};
return NgameSubmitComponent;
}(SampleApi));
var ResurrectionComponent = (function (_super) {
__extends(ResurrectionComponent, _super);
function ResurrectionComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'resurrection';
_this.uri = '/hdtool/recon/ngame/resurrection';
_this.method = 'POST';
return _this;
}
ResurrectionComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return ResurrectionComponent;
}(SampleApi));
var ResurrectionStatusComponent = (function (_super) {
__extends(ResurrectionStatusComponent, _super);
function ResurrectionStatusComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'resurrectionStatus';
_this.uri = '/hdtool/recon/ngame/resurrectionStatus';
_this.method = 'POST';
return _this;
}
ResurrectionStatusComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId, resurrecOrderId: this.resurrecOrderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return ResurrectionStatusComponent;
}(SamplePollingApi));
var GetGameOrderInfoComponent = (function (_super) {
__extends(GetGameOrderInfoComponent, _super);
function GetGameOrderInfoComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'getGameOrderInfo';
_this.uri = '/hdtool/recon/getGameOrderInfo';
_this.method = 'POST';
return _this;
}
GetGameOrderInfoComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return GetGameOrderInfoComponent;
}(SamplePollingApi));
var GetGameSubmitComponent = (function (_super) {
__extends(GetGameSubmitComponent, _super);
function GetGameSubmitComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'getGameSubmit';
_this.uri = '/hdtool/recon/getGameSubmit';
_this.method = 'POST';
return _this;
}
GetGameSubmitComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId, facePrice: this.facePrice });
_super.prototype.execute.call(this);
return [2];
});
});
};
return GetGameSubmitComponent;
}(SampleApi));
var CheckOutAnswerComponent = (function (_super) {
__extends(CheckOutAnswerComponent, _super);
function CheckOutAnswerComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'checkOutAnswer';
_this.uri = '/hdtool/recon/checkOutAnswer';
_this.method = 'GET';
return _this;
}
CheckOutAnswerComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId, answerData: this.answerData });
_super.prototype.execute.call(this);
return [2];
});
});
};
return CheckOutAnswerComponent;
}(SampleApi));
var GetQuestionComponent = (function (_super) {
__extends(GetQuestionComponent, _super);
function GetQuestionComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'getQuestionInfo';
_this.uri = '/recon/getQuestionInfo';
_this.method = 'GET';
return _this;
}
GetQuestionComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { activityId: this.activityId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return GetQuestionComponent;
}(SampleApi));
var QuestionSubmitComponent = (function (_super) {
__extends(QuestionSubmitComponent, _super);
function QuestionSubmitComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'questionSubmit';
_this.uri = '/hdtool/recon/questionSubmit';
_this.method = 'POST';
return _this;
}
QuestionSubmitComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId, answerData: this.answerData });
_super.prototype.execute.call(this);
return [2];
});
});
};
return QuestionSubmitComponent;
}(SampleApi));
var AjaxThroughInfoComponent = (function (_super) {
__extends(AjaxThroughInfoComponent, _super);
function AjaxThroughInfoComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'ajaxThroughInfo';
_this.uri = '/hdtool/recon/ajaxThroughInfo';
_this.method = 'GET';
return _this;
}
AjaxThroughInfoComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { duibaId: this.duibaId, throughId: this.throughId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return AjaxThroughInfoComponent;
}(SampleApi));
var ThroughSubmitComponent = (function (_super) {
__extends(ThroughSubmitComponent, _super);
function ThroughSubmitComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'throughSubmit';
_this.uri = '/hdtool/recon/throughSubmit';
_this.method = 'GET';
return _this;
}
ThroughSubmitComponent.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
injectProp(this.params, { orderId: this.orderId });
_super.prototype.execute.call(this);
return [2];
});
});
};
return ThroughSubmitComponent;
}(SampleApi));
var eventEmitter = new EventEmitter(); var eventEmitter = new EventEmitter();
var SceneStart = (function (_super) { var SceneStart = (function (_super) {
...@@ -6426,7 +7015,7 @@ ...@@ -6426,7 +7015,7 @@
DialogContent.prototype.setup = function (data) { DialogContent.prototype.setup = function (data) {
}; };
return DialogContent; return DialogContent;
}(Component)); }(ScillaComponent));
var Popup = (function (_super) { var Popup = (function (_super) {
__extends(Popup, _super); __extends(Popup, _super);
...@@ -6539,7 +7128,7 @@ ...@@ -6539,7 +7128,7 @@
return undefined; return undefined;
}; };
return ScenePlay; return ScenePlay;
}(Component)); }(ScillaComponent));
var alien; var alien;
(function (alien) { (function (alien) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -77,6 +77,6 @@ export default class CameraController extends ScillaComponent { ...@@ -77,6 +77,6 @@ export default class CameraController extends ScillaComponent {
this.followPosition.setXY(width / 2, height / 2).subtract(this.targetPosition); this.followPosition.setXY(width / 2, height / 2).subtract(this.targetPosition);
position.copyFrom(math.lerpObj(position, this.followPosition, 0.1, Vector2D, ['x', 'y'])); // position.copyFrom(math.lerpObj(position, this.followPosition, 0.1, Vector2D, ['x', 'y']));
} }
} }
...@@ -10,7 +10,6 @@ import TouchZoom from './animation/TouchZoom'; ...@@ -10,7 +10,6 @@ import TouchZoom from './animation/TouchZoom';
import Wave from './animation/Wave'; import Wave from './animation/Wave';
import ZoomLoop from './animation/ZoomLoop'; import ZoomLoop from './animation/ZoomLoop';
import InteractComponent from './base/InteractComponent'; import InteractComponent from './base/InteractComponent';
import ScillaComponent from './base/ScillaComponent';
import TouchInterrupt from './base/TouchInterrupt'; import TouchInterrupt from './base/TouchInterrupt';
import Transform from './base/Transform'; import Transform from './base/Transform';
import AjaxElementComponent from './net/api/hdtool/base/AjaxElementComponent'; import AjaxElementComponent from './net/api/hdtool/base/AjaxElementComponent';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment