void CheckClock()
    {
        if (dayRef.GetMeridiem() == DayNightCycle.Meridiem.AM)
        {
            if (dayRef.GetHour() < 10f && dayRef.GetMinute() <= 10f)
            {
                uiText[5].text = "0" + Mathf.Abs(dayRef.GetHour()).ToString() + " : " + "0" + Mathf.Abs(dayRef.GetMinute()).ToString() + " AM";
            }

            if (dayRef.GetHour() < 10f && dayRef.GetMinute() >= 10f)
            {
                uiText[5].text = "0" + Mathf.Abs(dayRef.GetHour()).ToString() + " : " + Mathf.Abs(dayRef.GetMinute()).ToString() + " AM";
            }

            if (dayRef.GetHour() >= 10f && dayRef.GetMinute() >= 10f)
            {
                uiText[5].text = Mathf.Abs(dayRef.GetHour()) + " : " + Mathf.Abs(dayRef.GetMinute()).ToString() + " AM";
            }
        }

        if (dayRef.GetMeridiem() == DayNightCycle.Meridiem.PM)
        {
            if (dayRef.GetHour() < 10f && dayRef.GetMinute() <= 10f)
            {
                uiText[5].text = "0" + Mathf.Abs(dayRef.GetHour()).ToString() + " : " + "0" + Mathf.Abs(dayRef.GetMinute()).ToString() + " PM";
            }

            if (dayRef.GetHour() < 10f && dayRef.GetMinute() >= 10f)
            {
                uiText[5].text = "0" + Mathf.Abs(dayRef.GetHour()).ToString() + " : " + Mathf.Abs(dayRef.GetMinute()).ToString() + " PM";
            }

            if (dayRef.GetHour() >= 10f && dayRef.GetMinute() >= 10f)
            {
                uiText[5].text = Mathf.Abs(dayRef.GetHour()).ToString() + " : " + Mathf.Abs(dayRef.GetMinute()).ToString() + " PM";
            }
        }
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (!nightComplete)
        {
            spawnTimer += Time.deltaTime;

            if (dayRef.GetMeridiem() == DayNightCycle.Meridiem.PM)
            {
                if (dayRef.GetHour() == 8)
                {
                    if (dayRef.CanCycle())
                    {
                        dayRef.SetCycle(false);
                    }

                    if (spawnTimer >= spawnRate)
                    {
                        SpawnWave();
                    }
                }
            }
        }

        if (spawnCurrency <= 0)
        {
            EndNight();

            if (dayRef.GetMeridiem() == DayNightCycle.Meridiem.AM)
            {
                if (dayRef.GetHour() >= 6)
                {
                    SetNightSpawnCurrency();
                    dayRef.SetMinuteToSecond(1.0f);
                    nightComplete = false;
                }
            }
        }
    }
Example #3
0
    public void CheckTime()
    {
        if (dayRef.GetMeridiem() == DayNightCycle.Meridiem.AM)
        {
            if (dayRef.GetHour() < 6f)
            {
                turretSpotLight.SetActive(true);
            }

            else if (dayRef.GetHour() >= 6f)
            {
                turretSpotLight.SetActive(false);
            }
        }

        if (dayRef.GetMeridiem() == DayNightCycle.Meridiem.PM)
        {
            if (dayRef.GetHour() >= 6)
            {
                turretSpotLight.SetActive(true);
            }
        }
    }