예제 #1
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;
                }
            }
        }
    }