public void NewAgent(Controllable potentialAgent) { if (affectedWire) { affectedWire.endColor = Color.white; affectedWire = null; } currentAgent.input = currentAgent.defaultInput; currentAgent.ResumeInput(); currentAgent = potentialAgent; currentAgent.PauseInput(); currentAgent.input = input; affectedWire = currentAgent.GetComponentInChildren <LineRenderer>(); if (affectedWire) { affectedWire.endColor = Color.green; } if (ControlingEnemy()) { mindControl.ControlEffect(); } else { mindControl.ControlEffectEnd(); } }