示例#1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         _colliding = true;
         _squish.Squish();
     }
 }
示例#2
0
    private void Update()
    {
        Vector2 newPos = _rect.anchoredPosition;

        switch (_effect)
        {
        case TextEffect.Wavy:
            newPos.y = _startPos.y + (_amplitude * Mathf.Sin((Time.frameCount * _frequency) + (Index * _offset)));
            break;

        case TextEffect.Shaky:
            newPos.y = _startPos.y + Random.Range(-_shakeSize, _shakeSize);
            break;

        case TextEffect.Normal:
            break;

        default:
            break;
        }

        _rect.anchoredPosition = newPos;

        if (!_squished)
        {
            _squished = true;
            _squish.Squish();
        }
    }
示例#3
0
    private void MoveMouse()
    {
        Mouse.anchoredPosition += new Vector2(InputController.GetLeftJoystickFromPlayer(PlayerNumber).x, InputController.GetLeftJoystickFromPlayer(PlayerNumber).z) * _csm.MouseMoveSpeed;

        //juice
        float x = InputController.GetRawLeftJoystickFromPlayer(PlayerNumber).x;

        if (x != 0)
        {
            _amplitude  = _maxAmplitude * -x;
            _frameCount = 1 / _freq;
        }
        float sin = _amplitude * Mathf.Sin(_frameCount * _freq);

        Mouse.localRotation = Quaternion.Lerp(Mouse.localRotation, Quaternion.Euler(0, 0, sin), 10 * Time.deltaTime);
        _amplitude          = Mathf.Lerp(_amplitude, 0, Time.deltaTime * 3);

        if (InputController.IsAButtonPressed(PlayerNumber))
        {
            _squish.Squish();
        }
    }