示例#1
0
    private void CheckLeaderDestination()
    {
        if (lastDestinationLeader.CompareTag("Empty Space"))
        {
            Destination = lastDestinationLeader.gameObject;
        }
        else
        {
            Destination = lastDestinationLeader.GetComponentInChildren <GridSystem>().gameObject;
        }

        bool IgnoreDestination = ImportantIgnoratePicture.Contains(Destination.GetComponentInParent <PictureInfo>());

        if (!IgnoreDestination)
        {
            if (Destination.GetComponent <GridSystem>().HaveAvailablePoint())
            {
                if (!Destination.CompareTag("Empty Space"))
                {
                    VisitedPictures.Add(Destination.GetComponentInParent <PictureInfo>());
                }
            }
            else
            {
                InPausa = true;

                DestinationPrePause = Destination;
                Destination         = GetMostCloseEmptySpace(groupData.leader.GetComponent <BotVisitData>().destinationPoint.transform);
            }
        }

        lastDestinationLeader = null;
        UpdateDestinationPoint();
        GoToDestinationPoint();
    }