private void Update() { if (_time <= 0) { switch (Direction) { case WaveDirection.Left: _water.Splash(_water.GetLeftPosition(), Force.GetValue()); break; case WaveDirection.Right: _water.Splash(_water.GetRightPosition(), Force.GetValue()); break; default: throw new ArgumentOutOfRangeException(); } _time = Period; } _time -= Time.deltaTime; }
private void ApplyFloatingForce() { _rigidbody2D.AddForce(new Vector2(0, -_floatingForce.GetValue()), ForceMode2D.Impulse); }