示例#1
0
        public void ValidateDate(int days, Temporality temporality, bool expected)
        {
            var attribute = new DateAttribute(temporality);
            var actual    = attribute.IsValid(DateTime.Now.AddDays(days));

            Assert.AreEqual(expected, actual);
        }
示例#2
0
    // Makes sure the temporality interface looks normal by disabling
    // one button (the one of the current temporality) : play, pause or playfaster
    void DisableOneButton()
    {
        Temporality temporality          = GameManager.instance.temporality;
        bool        oneAtLeastIsDisabled = false;

        foreach (Transform child in timescaleButtonHolder.transform)
        {
            Button timeButton = child.GetComponent <Button>();
            if (!timeButton.interactable)
            {
                oneAtLeastIsDisabled = true;
            }
        }
        if (!oneAtLeastIsDisabled)
        {
            switch (temporality.timeScale)
            {
            default: PlayTimeFaster(); break;

            case 0: PauseTime(); break;

            case 1: PlayTime(); break;
            }
        }
    }
示例#3
0
    public void PlayTimeFaster()
    {
        Temporality temporality = GameManager.instance.temporality;

        temporality.SetTimeScale(2);
        EnableButtonsExcept(playFasterButton);

        PlayTimeSound(2);
    }
示例#4
0
    public void PauseTime()
    {
        Temporality temporality = GameManager.instance.temporality;

        temporality.SetTimeScale(0);
        EnableButtonsExcept(pauseButton);

        PlayTimeSound(0);
    }
示例#5
0
    IEnumerator UpdateEnvironmentalFX()
    {
        if (directionalLight == null)
        {
            if (!FindDirectionalLight())
            {
                yield return(false);
            }
        }

        Temporality temp = GameManager.instance.temporality;

        UpdateLights(temp.GetCurrentCycleProgression());
        UpdateFog(temp.GetCurrentCycleProgression());
        UpdateSkybox(temp.GetCurrentCycleProgression());
        DynamicGI.UpdateEnvironment();
        yield return(new WaitForSeconds(refreshRate));

        yield return(UpdateEnvironmentalFX());
    }
示例#6
0
    public IEnumerator UpdateInterface()
    {
        Temporality temporality = GameManager.instance.temporality;

        int minutes = Mathf.FloorToInt(
            ((0.2f + temporality.GetCurrentCycleProgression() / 100) % 1)
            * 24 * 60);
        int hours = Mathf.FloorToInt(minutes / 60);

        minutes -= hours * 60;

        UpdateCycleText(minutes, hours, temporality.GetCycle(), temporality.GetYear());
        // UpdateDayNightDisplay(temporality.GetCurrentCycleProgression());

        DisableOneButton();

        yield return(new WaitForSeconds(FindObjectOfType <Interface>().refreshRate));

        yield return(StartCoroutine(UpdateInterface()));
    }
示例#7
0
    void FindAllReferences()
    {
        // SYSTEM
        if (temporality == null)
        {
            temporality = FindObjectOfType <Temporality>();
        }
        if (flagReader == null)
        {
            flagReader = FindObjectOfType <FlagReader>();
        }
        if (library == null)
        {
            library = FindObjectOfType <Library>();
        }
        if (soundManager == null)
        {
            soundManager = FindObjectOfType <SoundManager>();
        }
        if (systemManager == null)
        {
            systemManager = FindObjectOfType <SystemManager>();
        }
        if (missionCallbackManager == null)
        {
            missionCallbackManager = FindObjectOfType <MissionCallbackManager>();
        }
        if (missionManager == null)
        {
            missionManager = FindObjectOfType <MissionManager>();
        }
        if (cursorManagement == null)
        {
            cursorManagement = FindObjectOfType <CursorManagement>();
        }
        if (gridManagement == null)
        {
            gridManagement = FindObjectOfType <GridManagement>();
        }
        if (populationManager == null)
        {
            populationManager = FindObjectOfType <PopulationManager>();
        }
        if (saveManager == null)
        {
            saveManager = FindObjectOfType <SaveManager>();
        }
        if (cinematicManager == null)
        {
            cinematicManager = FindObjectOfType <CinematicManager>();
        }
        if (cityManager == null)
        {
            cityManager = FindObjectOfType <CityManager>();
        }
        if (bulletinsManager == null)
        {
            bulletinsManager = FindObjectOfType <BulletinsManager>();
        }
        if (overlayManager == null)
        {
            overlayManager = FindObjectOfType <OverlayManager>();
        }
        if (timelineController == null)
        {
            timelineController = FindObjectOfType <TimelineController>();
        }
        if (player == null)
        {
            player = FindObjectOfType <Player>();
        }
        if (eventManager == null)
        {
            eventManager = FindObjectOfType <EventManager>();
        }
        if (animationManager == null)
        {
            animationManager = FindObjectOfType <AnimationManager>();
        }
        if (achievementManager == null)
        {
            achievementManager = FindObjectOfType <AchievementManager>();
        }
        if (roamerManager == null)
        {
            roamerManager = FindObjectOfType <RoamerManager>();
        }
        if (environmentalFX == null)
        {
            environmentalFX = FindObjectOfType <EnvironmentalFX>();
        }


        // INTERFACE
        if (localization == null)
        {
            localization = FindObjectOfType <Localization>();
        }
        if (displayerManager == null)
        {
            displayerManager = FindObjectOfType <DisplayerManager>();
        }

        // INTERFACE - INGAME
        if (temporalityInterface == null)
        {
            temporalityInterface = FindObjectOfType <TemporalityInterface>();
        }
        if (tooltipGO == null)
        {
            tooltipGO = FindObjectOfType <TooltipGO>();
        }

        // DEBUG
        if (logger == null)
        {
            logger = FindObjectOfType <Logger>();
        }
    }
示例#8
0
 public DateAttribute(Temporality temporality)
 {
     Temporality = temporality;
 }