Example #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();
    }
Example #2
0
    private void CheckDestinationFromPause()
    {
        if (DestinationPrePause != null && DestinationPrePause.GetComponent <GridSystem>().HaveAvailablePoint())
        {
            if (!Destination.CompareTag("Empty Space"))
            {
                VisitedPictures.Add(Destination.GetComponentInParent <PictureInfo>());
            }

            timedelta           = 0;
            Destination         = DestinationPrePause;
            DestinationPrePause = null;
            InPausa             = false;
            UpdateDestinationPoint();
            GoToDestinationPoint();
        }
    }