36 lines
709 B
C#
36 lines
709 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DrawGizmoComponent : MonoBehaviour
|
|
{
|
|
enum Gizmo
|
|
{
|
|
WireCube,
|
|
WireSphere
|
|
}
|
|
|
|
[SerializeField]
|
|
private Gizmo gizmo = Gizmo.WireCube;
|
|
|
|
[SerializeField]
|
|
private Color color = Color.yellow;
|
|
|
|
private void OnDrawGizmos()
|
|
{
|
|
Gizmos.color = color;
|
|
|
|
switch (gizmo)
|
|
{
|
|
case Gizmo.WireCube:
|
|
Gizmos.DrawWireCube(transform.position, new Vector3(1, 1, 1));
|
|
break;
|
|
|
|
case Gizmo.WireSphere:
|
|
Gizmos.DrawWireSphere(transform.position, 0.5f);
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|