Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        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);
            }
        }