Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- namespace DefaultNamespace
- {
- public class PointsExample : MonoBehaviour
- {
- [SerializeField] private float _radius;
- [SerializeField] private float _pointRadius = 0.1f;
- [SerializeField] private PointInfo[] _points;
- private void OnDrawGizmos()
- {
- Gizmos.color = Color.green;
- var center = transform.position - transform.forward * _radius;
- Gizmos.DrawWireSphere(center, _radius);
- Gizmos.color = Color.red;
- foreach (var point in _points)
- {
- var position = center + point.Direction * _radius * point.percent;
- Gizmos.DrawWireSphere(position, _pointRadius);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment