@@ -6,23 +6,17 @@ public abstract class Event : MonoBehaviour, IDebug, ITriggerExecute
66 {
77 public QueueActions queue ;
88
9-
109 [ SerializeField ] protected ETriggerRunMode runMode = ETriggerRunMode . SYNCHRONOUSLY ;
1110 [ SerializeField ] protected ETriggerWorkMode workMode = ETriggerWorkMode . FIRE ;
1211
13-
1412 public bool once = true ;
1513
16-
1714 public bool debug ;
1815
19-
2016 [ SerializeField ] protected int countTriggered ;
2117
22-
2318 private ETriggerStates state = ETriggerStates . NOT_ACTIVATED ;
2419
25-
2620 protected GameObject whoTriggered ;
2721
2822 private void Start ( )
@@ -37,7 +31,6 @@ public void Log(string msg)
3731
3832 public abstract void Update ( ) ;
3933
40-
4134 public void Run ( GameObject obj )
4235 {
4336 if ( IsState ( ETriggerStates . NOT_ACTIVATED ) || IsState ( ETriggerStates . FINISHED ) )
@@ -83,8 +76,7 @@ public void Pause()
8376
8477 public abstract void End ( ) ;
8578
86-
87- protected bool UpdateSyn ( )
79+ protected bool UpdateSync ( )
8880 {
8981 if ( queue . Current ( ) == null )
9082 {
@@ -107,13 +99,11 @@ protected bool UpdateSyn()
10799 return CheckOver ( ) ;
108100 }
109101
110-
111- protected bool UpdateAsyn ( )
102+ protected bool UpdateAsync ( )
112103 {
113104 return CheckOver ( ) ;
114105 }
115106
116-
117107 private bool CheckOver ( )
118108 {
119109 if ( IsAllActionsExecuted ( ) )
@@ -151,7 +141,6 @@ private void NewStart(GameObject obj)
151141 countTriggered ++ ;
152142 }
153143
154-
155144 protected void PopAction ( GameObject obj )
156145 {
157146 queue . Next ( ) ;
@@ -164,21 +153,18 @@ protected void PopAction(GameObject obj)
164153 }
165154 }
166155
167-
168156 protected void RunSynchronously ( GameObject obj )
169157 {
170158 PopAction ( obj ) ;
171159 }
172160
173-
174161 protected void RunAsynchronously ( GameObject obj )
175162 {
176163 whoTriggered = obj ;
177164 Log ( "Starting asyn actions" ) ;
178165 foreach ( var action in queue . GetActions ( ) ) action . Run ( obj ) ;
179166 }
180167
181-
182168 protected bool IsAllActionsExecuted ( )
183169 {
184170 return queue . IsAllActionsExecuted ( ) ;
@@ -215,7 +201,6 @@ public bool IsState(ETriggerWorkMode workMode)
215201 return this . workMode == workMode ;
216202 }
217203
218-
219204 protected abstract void Init ( ) ;
220205 }
221206}
0 commit comments