using UnityEngine; namespace Colosseum { /// /// 팀 타입 열거형 /// public enum TeamType { None = 0, Player = 1, Enemy = 2, Neutral = 3, } /// /// 팀 정보를 관리하는 컴포넌트. /// 캐릭터나 엔티티에 추가하여 팀 구분에 사용합니다. /// public class Team : MonoBehaviour { [SerializeField] private TeamType teamType = TeamType.None; public TeamType TeamType => teamType; /// /// 같은 팀인지 확인 /// public static bool IsSameTeam(GameObject a, GameObject b) { if (a == null || b == null) return false; var teamA = a.GetComponent(); var teamB = b.GetComponent(); // 둘 다 팀이 없으면 같은 팀으로 처리 if (teamA == null && teamB == null) return true; // 한쪽만 팀이 없으면 다른 팀 if (teamA == null || teamB == null) return false; return teamA.TeamType == teamB.TeamType; } } }