private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { _colliding = true; _squish.Squish(); } }
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(); } }
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(); } }