Skip to content

Instantly share code, notes, and snippets.

@Hsgngr
Created July 28, 2020 10:46
Show Gist options
  • Save Hsgngr/2f6d3b1a618fb421ba9c88ae5b66ae7a to your computer and use it in GitHub Desktop.
Save Hsgngr/2f6d3b1a618fb421ba9c88ae5b66ae7a to your computer and use it in GitHub Desktop.
ChangeAgentStatus() of DummyBot.cs
public void changeAgentStatus()
{
switch (m_InfectionStatus)
{
case agentStatus.HEALTHY:
GetComponentInChildren<Renderer>().material = healthyMaterial;
break;
case agentStatus.INFECTED:
GetComponentInChildren<Renderer>().material = infectiousMaterial;
pandemicAreaObj.GetComponent<PandemicArea>().healthyCounter--;
pandemicAreaObj.GetComponent<PandemicArea>().InfectedCounter++;
//Add - reward here.
break;
case agentStatus.RECOVERED:
GetComponentInChildren<Renderer>().material = recoveredMaterial;
pandemicAreaObj.GetComponent<PandemicArea>().InfectedCounter--;
pandemicAreaObj.GetComponent<PandemicArea>().RecoveredCounter++;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment