2021년 4학년 1학기 기업연계프로젝트2 컴퓨터소프트웨어공학과 <원광투어팀> 팀장 : 송유진 팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.2 KiB

using UnityEngine;
namespace Unity.FPS.Game
{
// This class contains general information describing an actor (player or enemies).
// It is mostly used for AI detection logic and determining if an actor is friend or foe
public class Actor : MonoBehaviour
{
[Tooltip("Represents the affiliation (or team) of the actor. Actors of the same affiliation are friendly to each other")]
public int Affiliation;
[Tooltip("Represents point where other actors will aim when they attack this actor")]
public Transform AimPoint;
ActorsManager m_ActorsManager;
void Start()
{
m_ActorsManager = GameObject.FindObjectOfType<ActorsManager>();
DebugUtility.HandleErrorIfNullFindObject<ActorsManager, Actor>(m_ActorsManager, this);
// Register as an actor
if (!m_ActorsManager.Actors.Contains(this))
{
m_ActorsManager.Actors.Add(this);
}
}
void OnDestroy()
{
// Unregister as an actor
if (m_ActorsManager)
{
m_ActorsManager.Actors.Remove(this);
}
}
}
}