You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
573 B

2 years ago
  1. using UnityEngine;
  2. namespace DebugDrawEx
  3. {
  4. public class LineMonoBehaviour : MonoBehaviour
  5. {
  6. public Color Color { get; set; }
  7. public Vector3 Point1 { get; set; }
  8. public Vector3 Point2 { get; set; }
  9. public float Duration { get; set; }
  10. public bool DepthTest { get; set; }
  11. private void Update()
  12. {
  13. Duration -= Time.unscaledDeltaTime;
  14. if (Duration <= 0)
  15. Destroy(gameObject);
  16. DebugDraw.DrawLine(Point1, Point2, Color, 0, DepthTest);
  17. }
  18. }
  19. }