BITFALL/Assets/BITKit/UnityEditor/SceneGizmoReference.cs

30 lines
637 B
C#
Raw Normal View History

2024-02-22 16:26:51 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit.Scene
{
public class SceneGizmoReference : MonoBehaviour
{
[SerializeField] private bool draw;
[SerializeField] private Color color;
[SerializeField] private float size;
[SerializeField] private Optional<Vector3> bounds;
private void OnDrawGizmos()
{
if (draw is false) return;
var position = transform.position;
Gizmos.color = color;
Gizmos.DrawWireSphere(position, size);
if (bounds.Allow)
{
Gizmos.DrawWireCube(position+transform.rotation*bounds.Value/2, bounds.Value);
}
}
}
}