BeamPositionSetter.cs 576 B

1234567891011121314151617181920212223
  1. using UnityEngine;
  2. namespace Assets.Scripts.BeamWeapon
  3. {
  4. internal sealed class BeamPositionSetter : MonoBehaviour
  5. {
  6. private LineRenderer _lineRenderer;
  7. public void Set(Vector3 startPosition, Vector3 endPosition)
  8. {
  9. if (_lineRenderer == null)
  10. return;
  11. _lineRenderer.SetPosition(0, startPosition);
  12. _lineRenderer.SetPosition(1, endPosition);
  13. }
  14. private void Start()
  15. {
  16. _lineRenderer = GetComponent<LineRenderer>();
  17. }
  18. }
  19. }