File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Assets/BossRoom/Scripts/Server/Game/Character Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ private enum AIStateType
1717 IDLE ,
1818 }
1919
20- static readonly AIStateType [ ] k_AIStates = { AIStateType . ATTACK , AIStateType . IDLE } ;
20+ static readonly AIStateType [ ] k_AIStates = ( AIStateType [ ] ) Enum . GetValues ( typeof ( AIStateType ) ) ;
2121
2222 private ServerCharacter m_ServerCharacter ;
2323 private ActionPlayer m_ActionPlayer ;
@@ -71,12 +71,11 @@ private AIStateType FindBestEligibleAIState()
7171 {
7272 // for now we assume the AI states are in order of appropriateness,
7373 // which may be nonsensical when there are more states
74- for ( int i = 0 ; i < k_AIStates . Length ; i ++ )
74+ foreach ( AIStateType aiStateType in k_AIStates )
7575 {
76- var aiState = k_AIStates [ i ] ;
77- if ( m_Logics [ aiState ] . IsEligible ( ) )
76+ if ( m_Logics [ aiStateType ] . IsEligible ( ) )
7877 {
79- return aiState ;
78+ return aiStateType ;
8079 }
8180 }
8281
You can’t perform that action at this time.
0 commit comments