This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// ReSharper disable FieldCanBeMadeReadOnly.Global
namespace BITKit.Scene
{
public class SceneGizmoReference : MonoBehaviour
{
[Export]
public static bool AllowGizmos=true;
[SerializeField] private bool draw;
[SerializeField] private Color color;
[SerializeField] private float size;
[SerializeField] private Optional<Vector3> bounds;
private void OnDrawGizmosSelected()
{
if (draw is false || AllowGizmos is false) return;
var position = transform.position;
Gizmos.color = color;
Gizmos.DrawWireSphere(position, size);
if (bounds.Allow)
{
var rotation = transform.rotation;
Gizmos.DrawWireCube(position+rotation*bounds.Value/2, rotation*bounds.Value);
}
}
}
}