47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.Pool;
|
|
using UnityEngine.UIElements;
|
|
using XED;
|
|
using static UnityEngine.Rendering.DebugUI;
|
|
|
|
namespace XED
|
|
{
|
|
public class LinePoint : MonoBehaviour
|
|
{
|
|
public Vector3 position { get { return transform.position; } }
|
|
public Color color;
|
|
private MeshRenderer mr;
|
|
private BoxCollider coll;
|
|
public HashSet<LinePoint> connectPoints = new();
|
|
public bool visited;
|
|
public override void AfterAwake()
|
|
{
|
|
mr = GetComponent<MeshRenderer>();
|
|
coll = GetComponent<BoxCollider>();
|
|
}
|
|
public void Displayable(bool value)
|
|
{
|
|
mr.enabled = value;
|
|
coll.enabled = value;
|
|
}
|
|
|
|
public void Release()
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
|
|
public void Disconnect(LinePoint point)
|
|
{
|
|
connectPoints.Remove(point);
|
|
}
|
|
|
|
public void Connect(LinePoint point)
|
|
{
|
|
connectPoints.Add(point);
|
|
}
|
|
}
|
|
} |