Exemplo n.º 1
0
        private void PrepareEasing()
        {
            var destination = GetDestination();

            bool OnlyLeftKeyDown = Input.GetKey(KeyCode.LeftArrow) && !Input.GetKey(KeyCode.RightArrow);

            if (OnlyLeftKeyDown)
            {
                destination.x += -1;

                foreach (var sprite in _player.Renderers)
                {
                    sprite.flipX = false;
                }
            }

            bool OnlyRightKeyDown = Input.GetKey(KeyCode.RightArrow) && !Input.GetKey(KeyCode.LeftArrow);

            if (OnlyRightKeyDown)
            {
                destination.x += 1;

                foreach (var sprite in _player.Renderers)
                {
                    sprite.flipX = true;
                }
            }

            _easing = new QuadraticEaseInOut(_player.transform.position, destination, _duration);
        }
Exemplo n.º 2
0
        private void PrepareEasing()
        {
            _camera.DisableTracking();
            _camera.DisableRestrict();

            Vector3 startPosition       = _player.transform.position;
            Vector3 startCameraPosition = _camera.transform.position;
            Vector3 gatherPosition      = StageReference.Instance.StageData.RespawnPosition;

            if (_player.PlayerInfo.Team == 1)
            {
                gatherPosition.x *= -1;
            }

            _easing       = new QuadraticEaseInOut(startPosition, gatherPosition, _prepareDuration);
            _easingCamera = new QuadraticEaseInOut(startCameraPosition, gatherPosition + new Vector3(0, 0, _camera.OffsetZ), _prepareDuration);
        }