liuzhiwei
2020-11-11 10b5f44b36f3dd0d3bdc2fcc06aa13caaa611760
Assets/Scripts/TowerDefense/Level/AgentInsManager.cs
@@ -256,6 +256,34 @@
        }
    }
    /// <summary>
    /// 根据赛道获得该赛道的所有敌人
    /// </summary>
    /// <param name="tunel">赛道id (1~5)</param>
    /// <param name="isOppo">是否是对手的赛道</param>
    /// <returns></returns>
    public List<Agent> GetAgentsByTunel(int tunel, bool isOppo = false)
    {
        WaveLineAgentInsMgr[] waveLineAgents = isOppo ? getOppoWaveLineList() : GetWaveLineList();
        List<Agent> ret = new List<Agent>();
        for (int i = 0; i < waveLineAgents.Length; ++i)
        {
            if (i == tunel - 1)
            {
                for (int j = 0; j < waveLineAgents[i].listAgent.Count; ++j)
                {
                    if (waveLineAgents[i].listAgent[j].AgentType == SpawnAgentType.Normal)
                        ret.Add(waveLineAgents[i].listAgent[j]);
                }
                return ret;
            }
        }
        return null;
    }
    public List<Agent> agentList
    {
        get { return this.agentInsList; }