Commit 1695a8f5 authored by rockyl's avatar rockyl

补充

parent e62b80d2
......@@ -12,7 +12,7 @@
"complete"
],
"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",
"type": "builtin"
}
{
"name": "比较",
"desc": "比较两个值",
"props": {
"left": {
"alias": "左值",
......
{
"name": "入口",
"desc": "入口节点,每个行为的入口",
"props": {},
"output": [
"success"
......
{
"name": "日志",
"desc": "打印日志",
"props": {
"content": {
"alias": "内容",
"type": "string",
"default": ""
},
"error": {
"alias": "是否错误模式",
"type": "boolean",
"default": false
}
},
"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": "放置数据",
"desc": "在数据中心放置数据",
"props": {
"name": {
"type": "string",
......@@ -13,7 +14,6 @@
"output": [
"success"
],
"desc": "在数据中心放置数据",
"id": "put-data",
"script": "engine.gameStage.dataCenter.mutate(props.name, args, props.path);\nnext('success', args);\n",
"group": "base",
......
......@@ -2,7 +2,7 @@
"name": "弹出弹窗",
"desc": "根据视图名弹出弹窗",
"props": {
"target": {
"viewName": {
"alias": "目标视图名",
"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": "等待",
"desc": "等待一段时间后继续",
"props": {
"duration": {
"alias": "时间(毫秒)",
......
{
"name": "HttpRequest",
"desc": "http请求",
"props": {
"url": {
"type": "string",
......@@ -20,7 +21,6 @@
"failed",
"exception"
],
"desc": "http请求",
"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",
"group": "net",
......
......@@ -3,7 +3,7 @@
*/
if(props.closeAll){
engine.gameStage.popupContainer.pop();
}else{
engine.gameStage.popupContainer.popAll();
}else{
engine.gameStage.popupContainer.pop();
}
{
"name": "比较",
"desc": "比较两个值",
"props": {
"left": {"alias": "左值","type": "any", "default": ""},
"right": {"alias": "右值","type": "any", "default": ""},
......
{
"name": "入口",
"desc": "入口节点,每个行为的入口",
"props": {},
"output": [
"success"
......
{
"name": "日志",
"desc": "打印日志",
"props": {
"content": {
"alias": "内容",
"type": "string",
"default": ""
},
"error": {
"alias": "是否错误模式",
"type": "boolean",
"default": false
}
},
"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": "放置数据",
"desc": "在数据中心放置数据",
"props": {
"name": {
"type": "string",
......@@ -12,6 +13,5 @@
},
"output": [
"success"
],
"desc": "在数据中心放置数据"
]
}
......@@ -2,7 +2,7 @@
"name": "弹出弹窗",
"desc": "根据视图名弹出弹窗",
"props": {
"target": {
"viewName": {
"alias": "目标视图名",
"type": "string"
},
......
......@@ -2,7 +2,7 @@
"name": "展示场景",
"desc": "根据视图名展示场景",
"props": {
"target": {
"viewName": {
"alias": "目标视图名",
"type": "string"
}
......
{
"name": "等待",
"desc": "等待一段时间后继续",
"props": {
"duration": {
"alias": "时间(毫秒)",
......
{
"name": "HttpRequest",
"desc": "http请求",
"props": {
"url": {"type": "string", "alias": "地址"},
"method": {"type": "enum", "enum": ["get", "post"], "alias": "方法", "default": "get"}
},
"output": ["success", "failed", "exception"],
"desc": "http请求"
"output": ["success", "failed", "exception"]
}
\ 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