Exemplo n.º 1
0
 void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
Exemplo n.º 2
0
 void OnEnable()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != this)
     {
         Debug.LogError("Try create another instance to a singleton class!");
     }
 }
Exemplo n.º 3
0
    /// <summary>
    /// Initialize game data
    /// </summary>
    private void InitializeGame()
    {
        InitGameObjectReferences();
        weekNumber   = 0;
        effectsNames = new List <string>();
        GameContext.pills.Pills.ForEach(pill => pill.alreadyTaken = false);
        hospitalHandler.ToggleBlue(true);
        pillManager   = new PillManager(pillImages, fruitImages);
        playerManager = new PlayerManager();
        eventManager  = new EventManager();

        ChangeStatementIfNeeded(true);
    }
Exemplo n.º 4
0
 private void Awake()
 {
     _pillManager = GetComponentInParent <PillManager>();
 }