using UnityEngine; using System.Collections.Generic; using Script.Gameplay.Connect; namespace Script.Gameplay.Interface { public interface IConnectable { public bool IsEnableConnect { get; set; } Vector3 GetPosition(); // 获取连接点位置 GameObject GetGameObject(); // 获取连接点物体 string GetConnectableName(); // 获取连接点名称 public List ConnectionLines { get; set; } // public static List GetConnectedGameObjects(GameObject sender) // { // IConnectable connectable = sender.GetComponent(); // List connectedObjects = new List(); // if (connectable != null) // { // foreach (var target in connectable.ConnectionLines) // { // if (target != null && target.PointA != null && target.PointB != null) // { // // 排除掉AB点中与sender相同的点 // if (target.PointA.GetGameObject() != sender) // { // connectedObjects.Add(target.PointA.GetGameObject()); // } // // if (target.PointB.GetGameObject() != sender) // { // connectedObjects.Add(target.PointB.GetGameObject()); // } // } // } // } // return connectedObjects; // } } }