Commit fe477e13 authored by rockyl's avatar rockyl

解决设置属性问题

解决回退场景问题
parent 9b0501ea
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"complete" "complete"
], ],
"id": "pop-scene", "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", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"success" "success"
], ],
"id": "set-mouse-enabled", "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", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"success" "success"
], ],
"id": "set-node-property", "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", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"success" "success"
], ],
"id": "set-node-visibility", "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", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"success" "success"
], ],
"id": "set-script-enabled", "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", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"success" "success"
], ],
"id": "set-script-property", "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", "group": "view",
"type": "builtin" "type": "builtin"
} }
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
} }
}, },
"id": "buried-point", "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,7 +20,7 @@ if(props.closeAll){ ...@@ -20,7 +20,7 @@ if(props.closeAll){
} }
}else{ }else{
engine.gameStage.popupContainer.pop(); engine.gameStage.sceneContainer.pop();
next('complete'); next('complete');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
let targetNode = target || props.target; let targetNode = props.target || target;
if(targetNode){ if(targetNode){
targetNode.mouseEnabled = props.enabled; targetNode.mouseEnabled = props.enabled;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
let targetNode = target || props.target; let targetNode = props.target || target;
if (targetNode) { if (targetNode) {
const {field, valueType, value} = props; const {field, valueType, value} = props;
if (field && value) { if (field && value) {
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
* Created by rockyl on 2019-11-16. * 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){ if(targetNode){
targetNode.visible = props.visible; targetNode.visible = visible;
} }
next('success', args); next('success', args);
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
let targetNode = target || props.target; let targetNode = props.target || target;
if (targetNode) { if (targetNode) {
const {scriptsProxy} = targetNode; const {scriptsProxy} = targetNode;
const {scriptIndex, scriptName, enabled} = props; const {scriptIndex, scriptName, enabled} = props;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
let targetNode = target || props.target; let targetNode = props.target || target;
if (targetNode) { if (targetNode) {
const {scriptsProxy} = targetNode; const {scriptsProxy} = targetNode;
const {scriptIndex, scriptName, enabled} = props; const {scriptIndex, scriptName, enabled} = props;
......
...@@ -10,9 +10,9 @@ export default class BuriedPoint extends engine.ScriptBase { ...@@ -10,9 +10,9 @@ export default class BuriedPoint extends engine.ScriptBase {
dom: string = '0.0.0.0'; dom: string = '0.0.0.0';
mounted() { mounted() {
this.dpm && fill(this.dpm); this.dpm && (this.dpm = fill(this.dpm));
this.dcm && fill(this.dcm); this.dcm && (this.dcm = fill(this.dcm));
this.dom && fill(this.dom); this.dom && (this.dom = fill(this.dom));
this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this); this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);
} }
...@@ -38,7 +38,7 @@ function log(type, data) { ...@@ -38,7 +38,7 @@ function log(type, data) {
let {dpm, dcm, dom} = data; let {dpm, dcm, dom} = data;
const params: any = { 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') { if (dom !== '0.0.0.0') {
params.dom = dom; 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