Commit 1695a8f5 authored by rockyl's avatar rockyl

补充

parent e62b80d2
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"complete" "complete"
], ],
"id": "close-dialog", "id": "close-dialog",
"script": "if (props.closeAll) {\n engine.gameStage.popupContainer.pop();\n}\nelse {\n engine.gameStage.popupContainer.popAll();\n}\n", "script": "if (props.closeAll) {\n engine.gameStage.popupContainer.popAll();\n}\nelse {\n engine.gameStage.popupContainer.pop();\n}\n",
"group": "base", "group": "base",
"type": "builtin" "type": "builtin"
} }
{ {
"name": "比较", "name": "比较",
"desc": "比较两个值",
"props": { "props": {
"left": { "left": {
"alias": "左值", "alias": "左值",
......
{ {
"name": "入口", "name": "入口",
"desc": "入口节点,每个行为的入口",
"props": {}, "props": {},
"output": [ "output": [
"success" "success"
......
{ {
"name": "日志", "name": "日志",
"desc": "打印日志",
"props": { "props": {
"content": { "content": {
"alias": "内容", "alias": "内容",
"type": "string", "type": "string",
"default": "" "default": ""
},
"error": {
"alias": "是否错误模式",
"type": "boolean",
"default": false
} }
}, },
"output": [ "output": [
......
{
"name": "回退场景",
"desc": "回退到上一个场景",
"props": {
"popAll": {
"alias": "是否回退到最低层场景",
"type": "boolean",
"default": false
},
"viewName": {
"alias": "目标视图名",
"type": "string"
}
},
"output": [
"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 }\n}\nelse {\n engine.gameStage.popupContainer.pop();\n}\n",
"group": "base",
"type": "builtin"
}
{ {
"name": "放置数据", "name": "放置数据",
"desc": "在数据中心放置数据",
"props": { "props": {
"name": { "name": {
"type": "string", "type": "string",
...@@ -13,7 +14,6 @@ ...@@ -13,7 +14,6 @@
"output": [ "output": [
"success" "success"
], ],
"desc": "在数据中心放置数据",
"id": "put-data", "id": "put-data",
"script": "engine.gameStage.dataCenter.mutate(props.name, args, props.path);\nnext('success', args);\n", "script": "engine.gameStage.dataCenter.mutate(props.name, args, props.path);\nnext('success', args);\n",
"group": "base", "group": "base",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "弹出弹窗", "name": "弹出弹窗",
"desc": "根据视图名弹出弹窗", "desc": "根据视图名弹出弹窗",
"props": { "props": {
"target": { "viewName": {
"alias": "目标视图名", "alias": "目标视图名",
"type": "string" "type": "string"
}, },
......
{
"name": "展示场景",
"desc": "根据视图名展示场景",
"props": {
"viewName": {
"alias": "目标视图名",
"type": "string"
}
},
"output": [
"complete"
],
"id": "show-scene",
"script": "if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\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}\n",
"group": "base",
"type": "builtin"
}
{ {
"name": "等待", "name": "等待",
"desc": "等待一段时间后继续",
"props": { "props": {
"duration": { "duration": {
"alias": "时间(毫秒)", "alias": "时间(毫秒)",
......
{ {
"name": "HttpRequest", "name": "HttpRequest",
"desc": "http请求",
"props": { "props": {
"url": { "url": {
"type": "string", "type": "string",
...@@ -20,7 +21,6 @@ ...@@ -20,7 +21,6 @@
"failed", "failed",
"exception" "exception"
], ],
"desc": "http请求",
"id": "http-request", "id": "http-request",
"script": "if (!props.url) {\n console.log('url is empty');\n next('exception', '\\'url is empty\\'');\n}\nelse {\n engine.globalLoader.httpRequest(function (s, payload) {\n if (s) {\n next('success', payload);\n }\n else {\n next('failed', payload);\n }\n }, props.url, props.method || 'get', 'json');\n}\n", "script": "if (!props.url) {\n console.log('url is empty');\n next('exception', '\\'url is empty\\'');\n}\nelse {\n engine.globalLoader.httpRequest(function (s, payload) {\n if (s) {\n next('success', payload);\n }\n else {\n next('failed', payload);\n }\n }, props.url, props.method || 'get', 'json');\n}\n",
"group": "net", "group": "net",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
if(props.closeAll){ if(props.closeAll){
engine.gameStage.popupContainer.pop();
}else{
engine.gameStage.popupContainer.popAll(); engine.gameStage.popupContainer.popAll();
}else{
engine.gameStage.popupContainer.pop();
} }
{ {
"name": "比较", "name": "比较",
"desc": "比较两个值",
"props": { "props": {
"left": {"alias": "左值","type": "any", "default": ""}, "left": {"alias": "左值","type": "any", "default": ""},
"right": {"alias": "右值","type": "any", "default": ""}, "right": {"alias": "右值","type": "any", "default": ""},
......
{ {
"name": "入口", "name": "入口",
"desc": "入口节点,每个行为的入口",
"props": {}, "props": {},
"output": [ "output": [
"success" "success"
......
{ {
"name": "日志", "name": "日志",
"desc": "打印日志",
"props": { "props": {
"content": { "content": {
"alias": "内容", "alias": "内容",
"type": "string", "type": "string",
"default": "" "default": ""
},
"error": {
"alias": "是否错误模式",
"type": "boolean",
"default": false
} }
}, },
"output": [ "output": [
......
/**
* Created by rockyl on 2019-11-16.
*/
if(props.closeAll){
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}else{
let gameStage = engine.gameStage;
let viewConfig = gameStage.getViewConfigByName(props.viewName);
if (viewConfig) {
let view = engine.instantiate(viewConfig);
gameStage.sceneContainer.push(view);
} else {
console.error('view config not exists');
}
}
}else{
engine.gameStage.popupContainer.pop();
}
{
"name": "回退场景",
"desc": "回退到上一个场景",
"props": {
"popAll": {
"alias": "是否回退到最低层场景",
"type": "boolean",
"default": false
},
"viewName": {
"alias": "目标视图名",
"type": "string"
}
},
"output": [
"complete"
]
}
\ No newline at end of file
{ {
"name": "放置数据", "name": "放置数据",
"desc": "在数据中心放置数据",
"props": { "props": {
"name": { "name": {
"type": "string", "type": "string",
...@@ -12,6 +13,5 @@ ...@@ -12,6 +13,5 @@
}, },
"output": [ "output": [
"success" "success"
], ]
"desc": "在数据中心放置数据"
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "弹出弹窗", "name": "弹出弹窗",
"desc": "根据视图名弹出弹窗", "desc": "根据视图名弹出弹窗",
"props": { "props": {
"target": { "viewName": {
"alias": "目标视图名", "alias": "目标视图名",
"type": "string" "type": "string"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "展示场景", "name": "展示场景",
"desc": "根据视图名展示场景", "desc": "根据视图名展示场景",
"props": { "props": {
"target": { "viewName": {
"alias": "目标视图名", "alias": "目标视图名",
"type": "string" "type": "string"
} }
......
{ {
"name": "等待", "name": "等待",
"desc": "等待一段时间后继续",
"props": { "props": {
"duration": { "duration": {
"alias": "时间(毫秒)", "alias": "时间(毫秒)",
......
{ {
"name": "HttpRequest", "name": "HttpRequest",
"desc": "http请求",
"props": { "props": {
"url": {"type": "string", "alias": "地址"}, "url": {"type": "string", "alias": "地址"},
"method": {"type": "enum", "enum": ["get", "post"], "alias": "方法", "default": "get"} "method": {"type": "enum", "enum": ["get", "post"], "alias": "方法", "default": "get"}
}, },
"output": ["success", "failed", "exception"], "output": ["success", "failed", "exception"]
"desc": "http请求"
} }
\ No newline at end of file
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