|
|
|
|
|
|
using System; |
|
|
|
public class BaseTeamManager : ITeamManager |
|
|
|
public class BaseTeamManager : ITeamManager, IDisposable |
|
|
|
{ |
|
|
|
int m_StepCount; |
|
|
|
int m_TeamMaxStep; |
|
|
|
|
|
|
Academy.Instance.TeamManagerStep += _ManagerStep; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
Academy.Instance.TeamManagerStep -= _ManagerStep; |
|
|
|
} |
|
|
|
|
|
|
|
void _ManagerStep() |
|
|
|
{ |
|
|
|
m_StepCount += 1; |
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Register the agent to the TeamManager.
|
|
|
|
/// Registered agents will be able to receive team rewards from the TeamManager.
|
|
|
|
/// All agents in the same training area should be added to the same TeamManager.
|
|
|
|
/// Registered agents will be able to receive team rewards from the TeamManager
|
|
|
|
/// and share observations during training.
|
|
|
|
/// </summary>
|
|
|
|
public virtual void RegisterAgent(Agent agent) |
|
|
|
{ |
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Remove the agent from the TeamManager.
|
|
|
|
/// </summary>
|
|
|
|
public virtual void RemoveAgent(Agent agent) |
|
|
|
public virtual void UnregisterAgent(Agent agent) |
|
|
|
{ |
|
|
|
if (m_Agents.Contains(agent)) |
|
|
|
{ |
|
|
|