Skip to content

Conversation

@chriselion
Copy link
Contributor

Currently we add one method in OnEnableHelper() but remove another in OnDisable()

academy.AgentForceReset += _AgentReset;
m_PolicyFactory = GetComponent<BehaviorParameters>();
m_Brain = m_PolicyFactory.GeneratePolicy(Heuristic);
ResetData();
InitializeAgent();
InitializeSensors();
}
/// Monobehavior function that is called when the attached GameObject
/// becomes disabled or inactive.
void OnDisable()
{
var academy = FindObjectOfType<Academy>();
if (academy != null)
{
academy.AgentSetStatus -= SetStatus;
academy.AgentResetIfDone -= ResetIfDone;
academy.AgentSendState -= SendInfo;
academy.DecideAction -= DecideAction;
academy.AgentAct -= AgentStep;
academy.AgentForceReset -= ForceReset;

The original intent was probably to add ForceReset(), but to keep behavior consistent, we'll remove _AgentReset() instead

@chriselion chriselion merged commit 4a36bd4 into master Dec 12, 2019
@delete-merged-branch delete-merged-branch bot deleted the develop-MLA-423-Agent.ForceReset branch December 12, 2019 01:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants