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