Exemplo n.º 1
0
        private void SetAimPosition()
        {
            float localScaleAllAxis = _toScale.localScale.x;
            float max     = _minMaxZoom.y - _minMaxZoom.x;
            float percent = ((localScaleAllAxis - _minMaxZoom.y) * 100 / max) + 100;

            percent = Mathf.Clamp(percent / 100f, 0f, 1f);
            _lookAt.SetPercent(percent);
            _lookAt.Stick();
        }
Exemplo n.º 2
0
        /// <summary>
        /// move up-down in the dolly
        /// </summary>
        private void InputDolly()
        {
            Vector2 dirInput = _cameraInput;

            if (Mathf.Abs(dirInput.y) >= _deadZoneVerti)
            {
                float remapedInput = ExtMathf.Remap(Mathf.Abs(dirInput.y), _deadZoneVerti, 1f, 0f, 1f);
                _followPercent -= _speedDolly * remapedInput * Mathf.Sign(dirInput.y) * Time.deltaTime;
                _followPercent  = Mathf.Clamp(_followPercent, 0, 1f);
            }
            _follow.SetPercent(_followPercent);
        }