Commit fe477e13 authored by rockyl's avatar rockyl

解决设置属性问题

解决回退场景问题
parent 9b0501ea
......@@ -16,7 +16,7 @@
"complete"
],
"id": "pop-scene",
"script": "if (props.closeAll) {\n if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n }\n else {\n var gameStage = engine.gameStage;\n var viewConfig = gameStage.getViewConfigByName(props.viewName);\n if (viewConfig) {\n var view = engine.instantiate(viewConfig);\n gameStage.sceneContainer.push(view);\n }\n else {\n console.error('view config not exists');\n }\n next('complete');\n }\n}\nelse {\n engine.gameStage.popupContainer.pop();\n next('complete');\n}\n",
"script": "if (props.closeAll) {\n if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n }\n else {\n var gameStage = engine.gameStage;\n var viewConfig = gameStage.getViewConfigByName(props.viewName);\n if (viewConfig) {\n var view = engine.instantiate(viewConfig);\n gameStage.sceneContainer.push(view);\n }\n else {\n console.error('view config not exists');\n }\n next('complete');\n }\n}\nelse {\n engine.gameStage.sceneContainer.pop();\n next('complete');\n}\n",
"group": "view",
"type": "builtin"
}
......@@ -16,7 +16,7 @@
"success"
],
"id": "set-mouse-enabled",
"script": "var targetNode = target || props.target;\nif (targetNode) {\n targetNode.mouseEnabled = props.enabled;\n}\nnext('success', args);\n",
"script": "var targetNode = props.target || target;\nif (targetNode) {\n targetNode.mouseEnabled = props.enabled;\n}\nnext('success', args);\n",
"group": "view",
"type": "builtin"
}
......@@ -29,7 +29,7 @@
"success"
],
"id": "set-node-property",
"script": "var targetNode = target || props.target;\nif (targetNode) {\n var field = props.field, valueType = props.valueType, value = props.value;\n if (field && value) {\n var tValue = void 0;\n switch (valueType) {\n case 'number':\n tValue = parseFloat(value);\n break;\n case 'string':\n tValue = value;\n break;\n case 'boolean':\n tValue = value === 'true' ? true : (value === 'false' ? false : value);\n break;\n }\n if (tValue !== undefined) {\n targetNode[field] = tValue;\n }\n }\n}\nnext('success', args);\n",
"script": "var targetNode = props.target || target;\nif (targetNode) {\n var field = props.field, valueType = props.valueType, value = props.value;\n if (field && value) {\n var tValue = void 0;\n switch (valueType) {\n case 'number':\n tValue = parseFloat(value);\n break;\n case 'string':\n tValue = value;\n break;\n case 'boolean':\n tValue = value === 'true' ? true : (value === 'false' ? false : value);\n break;\n }\n if (tValue !== undefined) {\n targetNode[field] = tValue;\n }\n }\n}\nnext('success', args);\n",
"group": "view",
"type": "builtin"
}
......@@ -16,7 +16,7 @@
"success"
],
"id": "set-node-visibility",
"script": "var targetNode = target || props.target;\nif (targetNode) {\n targetNode.visible = props.visible;\n}\nnext('success', args);\n",
"script": "var visible = engine.findVariable('visible', args, props);\nvar targetNode = props.target || target;\nif (targetNode) {\n targetNode.visible = visible;\n}\nnext('success', args);\n",
"group": "view",
"type": "builtin"
}
......@@ -24,7 +24,7 @@
"success"
],
"id": "set-script-enabled",
"script": "var targetNode = target || props.target;\nif (targetNode) {\n var scriptsProxy = targetNode.scriptsProxy;\n var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;\n if (scriptIndex !== undefined) {\n var script = scriptsProxy.all[scriptIndex];\n if (script) {\n script.disabled = !enabled;\n }\n }\n else if (scriptName !== undefined) {\n var scripts = scriptsProxy.get(scriptName);\n for (var _i = 0, scripts_1 = scripts; _i < scripts_1.length; _i++) {\n var script = scripts_1[_i];\n script.disabled = !enabled;\n }\n }\n}\nnext('success', args);\n",
"script": "var targetNode = props.target || target;\nif (targetNode) {\n var scriptsProxy = targetNode.scriptsProxy;\n var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;\n if (scriptIndex !== undefined) {\n var script = scriptsProxy.all[scriptIndex];\n if (script) {\n script.disabled = !enabled;\n }\n }\n else if (scriptName !== undefined) {\n var scripts = scriptsProxy.get(scriptName);\n for (var _i = 0, scripts_1 = scripts; _i < scripts_1.length; _i++) {\n var script = scripts_1[_i];\n script.disabled = !enabled;\n }\n }\n}\nnext('success', args);\n",
"group": "view",
"type": "builtin"
}
......@@ -37,7 +37,7 @@
"success"
],
"id": "set-script-property",
"script": "var targetNode = target || props.target;\nif (targetNode) {\n var scriptsProxy = targetNode.scriptsProxy;\n var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;\n var script = void 0;\n if (scriptIndex !== undefined) {\n script = scriptsProxy.all[scriptIndex];\n }\n else if (scriptName !== undefined) {\n script = scriptsProxy.get(scriptName);\n }\n if (script) {\n var field = props.field, valueType = props.valueType, value = props.value;\n if (field && value) {\n var tValue = void 0;\n switch (valueType) {\n case 'number':\n tValue = parseFloat(value);\n break;\n case 'string':\n tValue = value;\n break;\n case 'boolean':\n tValue = value === 'true' ? true : (value === 'false' ? false : value);\n break;\n }\n if (tValue !== undefined) {\n script[field] = tValue;\n }\n }\n }\n}\nnext('success', args);\n",
"script": "var targetNode = props.target || target;\nif (targetNode) {\n var scriptsProxy = targetNode.scriptsProxy;\n var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;\n var script = void 0;\n if (scriptIndex !== undefined) {\n script = scriptsProxy.all[scriptIndex];\n }\n else if (scriptName !== undefined) {\n script = scriptsProxy.get(scriptName);\n }\n if (script) {\n var field = props.field, valueType = props.valueType, value = props.value;\n if (field && value) {\n var tValue = void 0;\n switch (valueType) {\n case 'number':\n tValue = parseFloat(value);\n break;\n case 'string':\n tValue = value;\n break;\n case 'boolean':\n tValue = value === 'true' ? true : (value === 'false' ? false : value);\n break;\n }\n if (tValue !== undefined) {\n script[field] = tValue;\n }\n }\n }\n}\nnext('success', args);\n",
"group": "view",
"type": "builtin"
}
......@@ -18,5 +18,5 @@
}
},
"id": "buried-point",
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BuriedPoint = (function (_super) {\n __extends(BuriedPoint, _super);\n function BuriedPoint() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dpm = '0.0.0.0';\n _this.dcm = '0.0.0.0';\n _this.dom = '0.0.0.0';\n return _this;\n }\n BuriedPoint.prototype.mounted = function () {\n this.dpm && fill(this.dpm);\n this.dcm && fill(this.dcm);\n this.dom && fill(this.dom);\n this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n };\n BuriedPoint.prototype.awake = function () {\n log('exposure', this);\n };\n BuriedPoint.prototype._onClick = function (e) {\n log('click', this);\n };\n BuriedPoint.id = 'buried-point';\n return BuriedPoint;\n}(engine.ScriptBase));\nexports.default = BuriedPoint;\nfunction fill(src) {\n var result = src;\n for (var key in engine.env) {\n result = result.replace(key, engine.env[key]);\n }\n return result;\n}\nfunction log(type, data) {\n var dpm = data.dpm, dcm = data.dcm, dom = data.dom;\n var params = {\n dpm: dpm, dcm: dcm, appID: engine.env.appID, projectID: engine.env.projectID\n };\n if (dom !== '0.0.0.0') {\n params.dom = dom;\n }\n var isExposure = type === 'exposure';\n engine.httpRequest(null, isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');\n}\n"
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BuriedPoint = (function (_super) {\n __extends(BuriedPoint, _super);\n function BuriedPoint() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dpm = '0.0.0.0';\n _this.dcm = '0.0.0.0';\n _this.dom = '0.0.0.0';\n return _this;\n }\n BuriedPoint.prototype.mounted = function () {\n this.dpm && (this.dpm = fill(this.dpm));\n this.dcm && (this.dcm = fill(this.dcm));\n this.dom && (this.dom = fill(this.dom));\n this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n };\n BuriedPoint.prototype.awake = function () {\n log('exposure', this);\n };\n BuriedPoint.prototype._onClick = function (e) {\n log('click', this);\n };\n BuriedPoint.id = 'buried-point';\n return BuriedPoint;\n}(engine.ScriptBase));\nexports.default = BuriedPoint;\nfunction fill(src) {\n var result = src;\n for (var key in engine.env) {\n result = result.replace(key, engine.env[key]);\n }\n return result;\n}\nfunction log(type, data) {\n var dpm = data.dpm, dcm = data.dcm, dom = data.dom;\n var params = {\n dpm: dpm, dcm: dcm, appId: engine.env.app_id\n };\n if (dom !== '0.0.0.0') {\n params.dom = dom;\n }\n var isExposure = type === 'exposure';\n engine.httpRequest(null, isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');\n}\n"
}
......@@ -20,8 +20,8 @@ if(props.closeAll){
}
}else{
engine.gameStage.popupContainer.pop();
engine.gameStage.sceneContainer.pop();
next('complete');
}
\ No newline at end of file
}
......@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16.
*/
let targetNode = target || props.target;
let targetNode = props.target || target;
if(targetNode){
targetNode.mouseEnabled = props.enabled;
}
......
......@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16.
*/
let targetNode = target || props.target;
let targetNode = props.target || target;
if (targetNode) {
const {field, valueType, value} = props;
if (field && value) {
......
......@@ -2,9 +2,11 @@
* Created by rockyl on 2019-11-16.
*/
let targetNode = target || props.target;
let visible = engine.findVariable('visible', args, props);
let targetNode = props.target || target;
if(targetNode){
targetNode.visible = props.visible;
targetNode.visible = visible;
}
next('success', args);
......@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16.
*/
let targetNode = target || props.target;
let targetNode = props.target || target;
if (targetNode) {
const {scriptsProxy} = targetNode;
const {scriptIndex, scriptName, enabled} = props;
......
......@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16.
*/
let targetNode = target || props.target;
let targetNode = props.target || target;
if (targetNode) {
const {scriptsProxy} = targetNode;
const {scriptIndex, scriptName, enabled} = props;
......
......@@ -10,9 +10,9 @@ export default class BuriedPoint extends engine.ScriptBase {
dom: string = '0.0.0.0';
mounted() {
this.dpm && fill(this.dpm);
this.dcm && fill(this.dcm);
this.dom && fill(this.dom);
this.dpm && (this.dpm = fill(this.dpm));
this.dcm && (this.dcm = fill(this.dcm));
this.dom && (this.dom = fill(this.dom));
this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);
}
......@@ -38,7 +38,7 @@ function log(type, data) {
let {dpm, dcm, dom} = data;
const params: any = {
dpm, dcm, appID: engine.env.appID, projectID: engine.env.projectID
dpm, dcm, appId: engine.env.app_id
};
if (dom !== '0.0.0.0') {
params.dom = dom;
......
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