
1.编写交互操作逻辑,我会用脚本给玩家物体添加一个子物体,子物体有一个触发器,当玩家按下交互键,通过回调看是否有Catch到的可交互物体,若有,我会触发可交互物体的OnCall,若没有,则不做反应。
2.编写可交互物体基类,可交互物体继承自Event,Start时检查碰撞盒状态。当检查到玩家进入触发器,把自己交给玩家的Catch。当检查到玩家离开触发器,看目前的Catch是否和自己一样,若一样则清除Catch,若不一样说明已经Catch了其他东西,不做反应。
3.编写绳结类,继承自可交互物体。当交互,给中介者发送信息,让中介者更改记录的当前记录的绳结是哪一个
(1.内含一个来自中介者的枚举类型的变量,记录自己属于哪一种绳结
(2.当OnCall,把自己的类型发给中介者
4.编写绳结中介者,负责玩家、皇帝和绳结的信息交流。
(1.有一个枚举类型,内含三种绳结种类
(2.有一个枚举类型的变量,记录当前记录的是哪一个绳结
(3.当绳结发来信息,更新记录的当前绳结
5.添加新的按键监听,并增加PlayerControl的虚函数
6.编写黄帝类
(1.继承自可交互物体
(2.内含一个来自中介者的枚举类型,记录皇帝对哪一种绳结提出要求
(3.当OnCall,检查中介者中记录的绳结和要求的是不是同一种,若是则触发后续流程,若不是,则触发摇头等动作,目前不做反应
(4.内含函数与后期外界对接,用来指定皇帝需要的绳结类型
*记得给Player类的Interact函数加上Base
我是每天上班提醒小助手,今天你上班了吗?😺
289 lines
10 KiB
Plaintext
289 lines
10 KiB
Plaintext
{
|
|
"name": "PlayerC",
|
|
"maps": [
|
|
{
|
|
"name": "Normal",
|
|
"id": "a9509238-4ac2-4968-9104-7e40d5ee5be8",
|
|
"actions": [
|
|
{
|
|
"name": "Move",
|
|
"type": "Value",
|
|
"id": "4850f4e1-f2c9-4d5c-bd75-a8673acfb61a",
|
|
"expectedControlType": "Axis",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": true
|
|
},
|
|
{
|
|
"name": "Atk",
|
|
"type": "Button",
|
|
"id": "514296f3-ecfc-4870-85d4-dd364fe8773e",
|
|
"expectedControlType": "Button",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": false
|
|
},
|
|
{
|
|
"name": "Jump",
|
|
"type": "Button",
|
|
"id": "abed25a0-995f-4034-84f5-d751e6bc0a7f",
|
|
"expectedControlType": "Button",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": false
|
|
},
|
|
{
|
|
"name": "Interact",
|
|
"type": "Button",
|
|
"id": "b014aa44-5a26-4e36-b7b0-2bf89fc8617c",
|
|
"expectedControlType": "Button",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": false
|
|
},
|
|
{
|
|
"name": "LeftChange",
|
|
"type": "Button",
|
|
"id": "5e4b2241-fdf3-4717-9892-456eb07bff7d",
|
|
"expectedControlType": "Button",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": false
|
|
},
|
|
{
|
|
"name": "RightChange",
|
|
"type": "Button",
|
|
"id": "25825820-ed63-4821-a570-98c0346d0114",
|
|
"expectedControlType": "Button",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": false
|
|
}
|
|
],
|
|
"bindings": [
|
|
{
|
|
"name": "Keyboard",
|
|
"id": "dfa90ca2-5172-40a9-a51c-0302d90846b4",
|
|
"path": "1DAxis",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Move",
|
|
"isComposite": true,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "negative",
|
|
"id": "034d425f-6336-4c6d-a571-d5bc9a090686",
|
|
"path": "<Keyboard>/a",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "Normal",
|
|
"action": "Move",
|
|
"isComposite": false,
|
|
"isPartOfComposite": true
|
|
},
|
|
{
|
|
"name": "positive",
|
|
"id": "d58eeeaf-86a4-4adc-acb8-c647c77cd7b4",
|
|
"path": "<Keyboard>/d",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "Normal",
|
|
"action": "Move",
|
|
"isComposite": false,
|
|
"isPartOfComposite": true
|
|
},
|
|
{
|
|
"name": "GamePad",
|
|
"id": "a4b44fd8-a2cb-4a05-ab0d-ac14de8d17b6",
|
|
"path": "1DAxis",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Move",
|
|
"isComposite": true,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "negative",
|
|
"id": "ca1377ed-502a-4c18-b5da-542b0ab2f78a",
|
|
"path": "<Gamepad>/leftStick/left",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "Normal",
|
|
"action": "Move",
|
|
"isComposite": false,
|
|
"isPartOfComposite": true
|
|
},
|
|
{
|
|
"name": "positive",
|
|
"id": "be7d0a09-9192-417e-b737-ea3e160f4156",
|
|
"path": "<Gamepad>/leftStick/right",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "Normal",
|
|
"action": "Move",
|
|
"isComposite": false,
|
|
"isPartOfComposite": true
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "74439205-ca18-4731-809e-9db029435012",
|
|
"path": "<Keyboard>/j",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Atk",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "41256d78-e271-4ffe-a025-708f7f7dd055",
|
|
"path": "<Gamepad>/buttonWest",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Atk",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "d26afab9-340e-4c38-905f-576f82ce664c",
|
|
"path": "<Gamepad>/buttonSouth",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Jump",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "310e0ce7-9635-4c78-bf18-8b46b039dbb4",
|
|
"path": "<Keyboard>/k",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Jump",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "56e4c8f3-5f31-4e4c-b216-914499d0d7a8",
|
|
"path": "<Keyboard>/f",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Interact",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "d38f2194-30e2-45a5-a803-89534727cf65",
|
|
"path": "<Gamepad>/buttonWest",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "Interact",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "848dbb1f-2a82-4dc8-9673-c7f69bc2eaa5",
|
|
"path": "<Keyboard>/q",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "LeftChange",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "d1bc2781-7f70-4170-93c3-c849ff56c3cf",
|
|
"path": "<Gamepad>/dpad/left",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "LeftChange",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "bdd4c52b-c221-49d3-b467-201ebc18cb71",
|
|
"path": "<Keyboard>/e",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "RightChange",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
},
|
|
{
|
|
"name": "",
|
|
"id": "257c9bb8-7e77-4e5c-9caf-97284fb0adbd",
|
|
"path": "<Gamepad>/dpad/right",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "",
|
|
"action": "RightChange",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Null",
|
|
"id": "d35487bf-8b39-4ef8-932a-e057537f5cff",
|
|
"actions": [
|
|
{
|
|
"name": "New action",
|
|
"type": "Button",
|
|
"id": "8227df78-160c-4425-939a-fb42da1254ef",
|
|
"expectedControlType": "Button",
|
|
"processors": "",
|
|
"interactions": "",
|
|
"initialStateCheck": false
|
|
}
|
|
],
|
|
"bindings": [
|
|
{
|
|
"name": "",
|
|
"id": "522de362-9c2e-4df0-8a98-33364cf3737b",
|
|
"path": "",
|
|
"interactions": "",
|
|
"processors": "",
|
|
"groups": "Normal",
|
|
"action": "New action",
|
|
"isComposite": false,
|
|
"isPartOfComposite": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"controlSchemes": [
|
|
{
|
|
"name": "Normal",
|
|
"bindingGroup": "Normal",
|
|
"devices": [
|
|
{
|
|
"devicePath": "<Gamepad>",
|
|
"isOptional": true,
|
|
"isOR": false
|
|
},
|
|
{
|
|
"devicePath": "<Keyboard>",
|
|
"isOptional": true,
|
|
"isOR": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |