You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| using UnityEngine.Serialization;
 | |
| 
 | |
| namespace Game
 | |
| {
 | |
|     public partial class LevelNodeMonsterWave : LevelNode, ILevelMonsterWave
 | |
|     {
 | |
|         [Rename("攻击周期(秒)")] public float attackRound;
 | |
|         [Rename("攻击频率(秒/次)")] public float attackFrequency;
 | |
|         [Rename("攻击次数")] public int attackTimes;
 | |
|         [Rename("近战人数")] public int attackerMelee;
 | |
|         [Rename("远程人数")] public int attackerLongRange;
 | |
| 
 | |
|         private int _waveIndex;
 | |
|         private LevelNodeMonster[] _monsterList;
 | |
|         private readonly Dictionary<EAIModuleType, int> _numAttackerDict = new Dictionary<EAIModuleType, int>();
 | |
| 
 | |
|         public override void OnInit()
 | |
|         {
 | |
|             _monsterList = GetComponentsInChildren<LevelNodeMonster>();
 | |
|             for (EAIModuleType i = 0; i < EAIModuleType.Max; i++)
 | |
|             {
 | |
|                 _numAttackerDict[i] = 0;
 | |
|             }
 | |
| 
 | |
|             _numAttackerDict[EAIModuleType.Melee] = attackerMelee;
 | |
|             _numAttackerDict[EAIModuleType.LongRange] = attackerLongRange;
 | |
|         }
 | |
| 
 | |
|         public LevelNodeMonster[] GetMonsters()
 | |
|         {
 | |
|             return _monsterList;
 | |
|         }
 | |
| 
 | |
|         public void SetWaveIndex(int index)
 | |
|         {
 | |
|             _waveIndex = index;
 | |
|         }
 | |
| 
 | |
|         public int GetWaveIndex()
 | |
|         {
 | |
|             return _waveIndex;
 | |
|         }
 | |
|     }
 | |
| } |