Esempio n. 1
0
 private void Start()
 {
     _target         = GetComponent <TargetScript>();
     _warrior        = GetComponent <WarriorScript>();
     _goTo           = GetComponent <GoToTargetScript>();
     _goTo           = GetComponent <GoToTargetScript>();
     _relationScript = GetComponent <RelationScript>();
 }
Esempio 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);
    }
Esempio n. 3
0
 public Relation GetRelation(RelationScript other)
 {
     // Find can be called before start
     return(_teams ? _teams.GetRelation(this, other) : Relation.Unknown);
 }