Пример #1
0
    public void SetIsPaused(bool paused)
    {
        if (isPaused == paused)
        {
            return;
        }

        if (pauseObjects.GetSet() != null)
        {
            if (pauseObjects.GetSet().Count > 0)
            {
                foreach (GameObject go in pauseObjects.GetSet())
                {
                    go.SetActive(!paused);
                }
            }
        }

        Time.timeScale = paused ? 0f : 1f;

        isPaused = paused;

        if (isPaused && OnPaused != null)
        {
            OnPaused.Invoke();
        }
        if (!isPaused && OnUnpaused != null)
        {
            OnUnpaused.Invoke();
        }
    }
Пример #2
0
 public void SetAllSpawnersSpawning(bool shouldSpawn)
 {
     foreach (GameObject spawnerObj in spawnerSet.GetSet())
     {
         PropSpawner spawnerComponent = spawnerObj.GetComponent <PropSpawner>();
         spawnerComponent.SetSpawning(shouldSpawn);
     }
 }