Exemplo n.º 1
0
        private void moveController(Vector2 input, float speedUnitsPerSecond)
        {
            Vector3 moveAmount = transform.forward * input.y + transform.right * input.x;

            // perform collision detection (to override default Unity char controller's 'slide along walls' for
            // LSD's janky 'lets just stop in place')
            if (movingIntoWall(moveAmount))
            {
                // we shouldn't move anymore
                moveAmount = Vector3.zero;

                // check to see if we should link
                if (_timeColliding > LinkDelay && _canLink)
                {
                    _canLink = false;
                    DreamSystem.Transition(RandUtil.RandColor());
                }
            }
            else
            {
                _timeColliding = 0;
            }

            // apply the movement speed
            moveAmount *= speedUnitsPerSecond;

            // move the controller
            _controller.Move(moveAmount * Time.deltaTime);
        }
Exemplo n.º 2
0
        public void OnTriggerEnter(Collider other)
        {
            if (!other.gameObject.CompareTag("Player"))
            {
                return;
            }

            if (!ForceFadeColor)
            {
                ForcedLinkColor = RandUtil.RandColor();
            }
            DreamSystem.Transition(ForcedLinkColor, LinkedLevel, PlayLinkSound, SpawnPointEntityID);
        }