Files
Colosseum/Assets/_Game/Scripts/Core/Team.cs
dal4segno c265f980db chore: Assets 디렉토리 구조 정리 및 네이밍 컨벤션 적용
- Assets/_Game/ 하위로 게임 에셋 통합
- External/ 패키지 벤더별 분류 (Synty, Animations, UI)
- 에셋 네이밍 컨벤션 확립 및 적용
  (Data_Skill_, Data_SkillEffect_, Prefab_, Anim_, Model_, BT_ 등)
- pre-commit hook으로 네이밍 컨벤션 자동 검사 추가
- RESTRUCTURE_CHECKLIST.md 작성

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 19:08:27 +09:00

45 lines
1.1 KiB
C#

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