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.

CurvedLinePoint.cs 651B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine;
  2. using System.Collections;
  3. public class CurvedLinePoint : MonoBehaviour
  4. {
  5. [HideInInspector] public bool showGizmo = true;
  6. [HideInInspector] public float gizmoSize = 0.1f;
  7. [HideInInspector] public Color gizmoColor = new Color(1,0,0,0.5f);
  8. void OnDrawGizmos()
  9. {
  10. if( showGizmo == true )
  11. {
  12. Gizmos.color = gizmoColor;
  13. Gizmos.DrawSphere( this.transform.position, gizmoSize );
  14. }
  15. }
  16. //update parent line when this point moved
  17. void OnDrawGizmosSelected()
  18. {
  19. CurvedLineRenderer curvedLine = this.transform.parent.GetComponent<CurvedLineRenderer>();
  20. if( curvedLine != null )
  21. {
  22. curvedLine.Update();
  23. }
  24. }
  25. }