Exemplo n.º 1
0
    public void CallForHelp()
    {
        List <Actor> friends = Decider.IdentifyFriends();

        // TODO: this should be possible as a Select, but there are type problems, and may be a problem if
        // actors are destroyed in process
        for (int i = 0; i < friends.Count; i++)
        {
            if (Me == null)
            {
                break;
            }
            if (friends[i] != null && !friends[i].Actions.Decider.FriendsInNeed.Contains(Me))
            {
                if (friends[i].GetComponent <Guard>() != null || Me.GetComponent <Guard>() != null)
                {
                    friends[i].Actions.Decider.FriendsInNeed.Add(Me);
                }
            }
        }
    }