Pro_Unit

Untitled

Feb 12th, 2021
863
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. namespace DefaultNamespace
  4. {
  5.     public class PointsExample : MonoBehaviour
  6.     {
  7.         [SerializeField] private float _radius;
  8.         [SerializeField] private float _pointRadius = 0.1f;
  9.  
  10.         [SerializeField] private PointInfo[] _points;
  11.  
  12.         private void OnDrawGizmos()
  13.         {
  14.             Gizmos.color = Color.green;
  15.             var center = transform.position - transform.forward * _radius;
  16.             Gizmos.DrawWireSphere(center, _radius);
  17.            
  18.             Gizmos.color = Color.red;
  19.  
  20.             foreach (var point in _points)
  21.             {
  22.                 var position = center + point.Direction * _radius * point.percent;
  23.                 Gizmos.DrawWireSphere(position, _pointRadius);
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment