Ejemplo n.º 1
0
 private void Start()
 {
     _target         = GetComponent <TargetScript>();
     _warrior        = GetComponent <WarriorScript>();
     _goTo           = GetComponent <GoToTargetScript>();
     _goTo           = GetComponent <GoToTargetScript>();
     _relationScript = GetComponent <RelationScript>();
 }
Ejemplo n.º 2
0
    public Relation GetRelation(RelationScript current, RelationScript other)
    {
        if (current.TeamId == other.TeamId)
        {
            return(Relation.Own);
        }

        var team = teams.First(description => description.teamId == current.TeamId);

        if (team.enemies.Contains(other.TeamId))
        {
            return(Relation.Enemy);
        }

        if (team.allies.Contains(other.TeamId))
        {
            return(Relation.Ally);
        }

        return(Relation.Neutral);
    }
Ejemplo n.º 3
0
 public Relation GetRelation(RelationScript other)
 {
     // Find can be called before start
     return(_teams ? _teams.GetRelation(this, other) : Relation.Unknown);
 }