-
Notifications
You must be signed in to change notification settings - Fork 324
/
Copy pathConversationCommands.cs
75 lines (63 loc) · 1.38 KB
/
ConversationCommands.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#region 注 释
/***
*
* Title:
*
* Description:
*
* Date:
* Version:
* Writer:
*
*/
#endregion
using UnityEngine;
namespace CZToolKit.ConversationResolver
{
[CommandName("timer")]
public struct TimerCommand : IConversationCommand
{
int timer;
public int Priority => 0;
public void SetUp(string[] _commandParams)
{
int.TryParse(_commandParams[0], out timer);
}
public void Process()
{
// 在这里写计时timer毫秒的代码
Debug.Log($"等待{timer}毫秒");
}
}
[CommandName("fade")]
public struct FadeCommand : IConversationCommand
{
bool show;
public int Priority => -9;
public void SetUp(string[] _commandParams)
{
show = _commandParams[0] == "true";
}
public void Process()
{
if (show)
Debug.Log("角色渐现");
else
Debug.Log("角色渐隐");
}
}
[CommandName("character")]
public struct CharacterCommand : IConversationCommand
{
string character;
public int Priority => -10;
public void SetUp(string[] _commandParams)
{
character = _commandParams[0];
}
public void Process()
{
Debug.Log(character);
}
}
}