|
|
|
|
|
|
{ |
|
|
|
foreach (var agent in m_Agents) |
|
|
|
{ |
|
|
|
// if (agent.gameObject.activeSelf)
|
|
|
|
if (agent.gameObject.activeInHierarchy) |
|
|
|
if (agent.enabled) |
|
|
|
{ |
|
|
|
agent.EpisodeInterrupted(); |
|
|
|
} |
|
|
|
|
|
|
{ |
|
|
|
foreach (var agent in m_Agents) |
|
|
|
{ |
|
|
|
if (agent.gameObject.activeInHierarchy) |
|
|
|
if (agent.enabled) |
|
|
|
{ |
|
|
|
agent.AddTeamReward(reward); |
|
|
|
} |
|
|
|
|
|
|
{ |
|
|
|
foreach (var agent in m_Agents) |
|
|
|
{ |
|
|
|
if (agent.gameObject.activeInHierarchy) |
|
|
|
if (agent.enabled) |
|
|
|
{ |
|
|
|
agent.SetTeamReward(reward); |
|
|
|
} |
|
|
|
|
|
|
{ |
|
|
|
foreach (var agent in m_Agents) |
|
|
|
{ |
|
|
|
if (agent.gameObject.activeInHierarchy) |
|
|
|
if (agent.enabled) |
|
|
|
{ |
|
|
|
agent.EndEpisode(); |
|
|
|
} |
|
|
|