@@ -37,8 +37,10 @@ private enum SpecialCharType { StartChar, CmdChar, EndChar, NormalChar }
37
37
38
38
void Start ( )
39
39
{
40
- //Init the Keywords Function.
40
+ //Register the Keywords Function.
41
41
specialCharFuncMap . Add ( "w" , ( ) => StartCoroutine ( CmdFun_w_Task ( ) ) ) ;
42
+ specialCharFuncMap . Add ( "r" , ( ) => StartCoroutine ( CmdFun_r_Task ( ) ) ) ;
43
+ specialCharFuncMap . Add ( "l" , ( ) => StartCoroutine ( CmdFun_l_Task ( ) ) ) ;
42
44
specialCharFuncMap . Add ( "lr" , ( ) => StartCoroutine ( CmdFun_lr_Task ( ) ) ) ;
43
45
}
44
46
@@ -54,6 +56,21 @@ public void SetText(string _text)
54
56
#endregion
55
57
56
58
#region Keywords Function
59
+ private IEnumerator CmdFun_l_Task ( )
60
+ {
61
+ IsOnCmdEvent = true ;
62
+ IsWaitingForNextToGo = true ;
63
+ yield return new WaitUntil ( ( ) => IsWaitingForNextToGo == false ) ;
64
+ IsOnCmdEvent = false ;
65
+ yield return null ;
66
+ }
67
+ private IEnumerator CmdFun_r_Task ( )
68
+ {
69
+ IsOnCmdEvent = true ;
70
+ msgText += '\n ' ;
71
+ IsOnCmdEvent = false ;
72
+ yield return null ;
73
+ }
57
74
private IEnumerator CmdFun_w_Task ( )
58
75
{
59
76
IsOnCmdEvent = true ;
@@ -68,6 +85,7 @@ private IEnumerator CmdFun_lr_Task()
68
85
IsOnCmdEvent = true ;
69
86
IsWaitingForNextToGo = true ;
70
87
yield return new WaitUntil ( ( ) => IsWaitingForNextToGo == false ) ;
88
+ msgText += '\n ' ;
71
89
IsOnCmdEvent = false ;
72
90
yield return null ;
73
91
}
@@ -94,7 +112,7 @@ private SpecialCharType CheckSpecialChar(char _char)
94
112
}
95
113
else if ( _char == SPECIAL_CHAR_END && IsOnSpecialChar )
96
114
{
97
- //execmd! !
115
+ //exe cmd !
98
116
if ( specialCharFuncMap . ContainsKey ( specialCmd ) )
99
117
{
100
118
specialCharFuncMap [ specialCmd ] ( ) ;
@@ -131,7 +149,6 @@ private IEnumerator SetTextTask(string _text)
131
149
lastChar = _text [ i ] ;
132
150
yield return new WaitUntil ( ( ) => IsOnCmdEvent == false ) ;
133
151
}
134
-
135
152
IsMsgCompleted = true ;
136
153
yield return null ;
137
154
}
0 commit comments