// Use this for initialization
 void Awake()
 {
     if (!instance)
     {
         instance = (DayChangeManager)FindObjectOfType(typeof(DayChangeManager));
         if (!instance)
         {
             Debug.LogError("There needs to be one active DayChangeManager script on a DayChangeManager in your scene.");
         }
     }
 }
Exemple #2
0
    // public GameObject object;

    public static DayChangeManager GetInstance()
    {
        if (!instance)
        {
            instance = (DayChangeManager)FindObjectOfType(typeof(DayChangeManager));
            if (!instance)
            {
                Debug.LogError("There needs to be one active DayChangeManager script on a DayChangeManager in your scene.");
            }
        }

        return(instance);
    }