public void AttachDriver(UnityMovementDriver driver) { StopAllCoroutines(); _trackingActive = false; if (driver == null) { throw new ArgumentNullException("driver"); } DetachDriver(); _driver = driver; _moving = false; _delta = Vector3.zero; foreach (var tracker in HistogramTrackers) { tracker.HistogramRenderer.RenderSize = new Vector2(Global.Config.HistogramWidth, Global.Config.HistogramHeight); } }
public void DetachDriver() { StopAllCoroutines(); _trackingActive = false; if (_driver != null) { _driver.Dispose(); } _moving = false; _delta = Vector3.zero; _driver = null; if (_chaser != null) { _chaser.gameObject.SetActive(false); } }
public void Start() { if (rigidbody != null) { Destroy(rigidbody); } if (collider != null) { Destroy(collider); } _subject = transform; _driver = null; _controller = gameObject.GetComponent <CharacterController>(); if (_chaser != null) { _chaser.gameObject.SetActive(false); } }