Beispiel #1
0
    public override void Show()
    {
        base.Show();
        arrivedInTime   = true;
        imageRecognizer = FindObjectOfType <ImageRecognizer>();
        Trip trip = GameManager.Instance.Player.Trip;

        fromTo.text = trip.CurrentCity.Name + " - " + trip.CurrentTransport.Option.To.Name;
        LoadTransportIcon();
        scanMarkerButton.SetActive(false);

        SetupEventGroup();
        eventGroup.Start();

        if (eventGroup.GetRemainingSeconds() > 25)
        {
            //MinigameController.Instance.LoadGame();
            quizScreen.SetActive(true);
            LoadQuestion();
            minigameSuccess = false;
            minigamePlaying = false;
        }
        else
        {
            minigamePlaying = false;
            minigameSuccess = true;
        }
    }
Beispiel #2
0
    private void StartTimeEvents(bool withPackages)
    {
        TimeManager.Instance.CancelEventGroup(eventGroupName);

        float maxStaySeconds = cityOptionsTime;

        if (withPackages)
        {
            int maxDays = packageHandler.packages.AsQueryable().Select(p => p.days).Max();
            maxStaySeconds = (float)TimeManager.CityDaysToGameSec(maxDays) + cityOptionsTime;
        }

        eventGroup = new TimeEventGroup(eventGroupName, maxStaySeconds);
        eventGroup.RegisterEvent(new TimeEvent("forceTravel", ForceTravel, 0, true));

        if (withPackages)
        {
            eventGroup.RegisterEvent(new TimeEvent("chooseNextTravel", ShowCityOptions, cityOptionsTime, true));
            packageHandler.SetupEvents(eventGroup);
        }

        TimeManager.Instance.RegisterEventGroup(eventGroup);
        eventGroup.Start();
    }