private void HandleEvent(object sender, PositionDirectionGameEvent gameEvent) { _emitParams.position = gameEvent.position; var angle = Mathf.Atan2(-gameEvent.direction.y, -gameEvent.direction.x) * Mathf.Rad2Deg; if (_useDirectionForRotationStart) { _emitParams.rotation = angle; } if (_useDirectionForEmmisionShapeAngle) { if (_flipEmissionShapeAngleBasedOnDirection && gameEvent.direction.x > 0.0f) { _shapeModule.rotation = new Vector3(0.0f, 0.0f, angle - _directionShapeRotationOffset - _shapeModule.arc); } else { _shapeModule.rotation = new Vector3(0.0f, 0.0f, angle + _directionShapeRotationOffset); } } _particleSystem.Emit(_emitParams, Random.Range(_minParticlesCount, _maxParticlesCount + 1)); }