public void OnEnable() { //We might have an rvoAgent //which was disabled previously //if so, we can simply add it to the simulation again if (rvoAgent != null) { simulator.AddAgent(rvoAgent); } else { rvoAgent = simulator.AddAgent(transform.position); } UpdateAgentProperties(); rvoAgent.Position = transform.position; adjustedY = rvoAgent.Position.y; }
public void OnEnable() { if (simulator == null) { return; } //We might have an rvoAgent //which was disabled previously //if so, we can simply add it to the simulation again if (rvoAgent != null) { simulator.AddAgent(rvoAgent); } else { rvoAgent = simulator.AddAgent(transform.position); } UpdateAgentProperties(); rvoAgent.Teleport(transform.position); }