private void OnDisable() { if (selfManaged) { agent = null; } if (m_agent == null) { return; } m_agent.navigationEnabled = false; m_agent.collisionEnabled = false; }
private void OnEnable() { if (selfManaged) { agent = ORCABeacon.Get.defaultBundle.NewAgent(transform.position); } if (m_agent == null) { return; } m_agent.pos = transform.position; m_agent.navigationEnabled = navigationEnabled; m_agent.collisionEnabled = collisionEnabled; }
private void OnDestroy() { agent = null; }