Files
Studio/Assets/Scripts/XED/Machine/AGV/AGVNode/NodeGizmoController.cs
2025-02-21 11:57:09 +09:00

37 lines
871 B
C#

using RTG;
using UnityEngine;
using XRLib;
namespace XED.Machine
{
public class NodeGizmoController : MonoBehaviour,ISingle
{
public ObjectTransformGizmo moveGizmo;
public GameObject target;
// Start is called before the first frame update
void Awake()
{
moveGizmo = RTGizmosEngine.Get.CreateObjectMoveGizmo();
moveGizmo.Gizmo.SetEnabled(false);
}
public void Attach(GameObject target)
{
moveGizmo.Gizmo.SetEnabled(true);
this.target = target.gameObject;
moveGizmo.SetTargetObject(target);
}
public void Detach()
{
moveGizmo.Gizmo.SetEnabled(false);
target = null;
}
internal bool GetGizmoHover()
{
return moveGizmo.Gizmo.IsHovered;
}
}
}