Ejemplo n.º 1
0
 public void Select(EntityModelSelectType type)
 {
     if (isSelectable)
     {
         entity.OnSelect(type);
         onSelect.Invoke();
         model.SetHighlight(CTeamComponent.GetRelation(TeamId.Team_0, m_TeamComponent.teamId));
     }
 }
Ejemplo n.º 2
0
    public static Relation GetRelation(CTeamComponent a, CTeamComponent b)
    {
        if (a == null || b == null)
        {
            return(Relation.None);
        }

        if (a.entity == b.entity)
        {
            return(Relation.Self);
        }
        else
        {
            return(GetRelation(a.teamId, b.teamId));
        }
    }
Ejemplo n.º 3
0
    public void SetController(CControllerComponent t)
    {
        m_Text.text = t.entity.keyName;
        Relation relation = CTeamComponent.GetRelation(TeamId.Team_0, t.teamId);

        switch (relation)
        {
        case Relation.Enemy:
            m_Image.color = Color.red;
            break;

        case Relation.Teammate:
            m_Image.color = Color.green;
            break;
        }
        gameObject.SetActive(true);
    }
Ejemplo n.º 4
0
 public Relation GetRelation(CTeamComponent other)
 {
     return(GetRelation(this, other));
 }
Ejemplo n.º 5
0
 protected override void OnInitializeComplete()
 {
     isSelectable    = true;
     m_TeamComponent = entity.GetCComponent <CTeamComponent>();
     base.OnInitializeComplete();
 }
Ejemplo n.º 6
0
 bool CheckRelation(CTakeDamageComponent target)
 {
     return(CTeamComponent.GetRelation(teamComponent, target.relationComponent) == Relation.Enemy);
 }