//singleton implemenation
    void Awake()
    {
        if (!GlobalVars.MEDICAL_USE) { // destroys the gameobject if medical use is not turned on
            Destroy(gameObject);
        } else if (instance == null) {
            instance = this;
            DontDestroyOnLoad (gameObject);

        } else {
            suppressOnLoadCall = true;
            Destroy(gameObject);
        }
    }
Beispiel #2
0
 //singleton implemenation
 void Awake()
 {
     if (!GlobalVars.MEDICAL_USE)           // destroys the gameobject if medical use is not turned on
     {
         Destroy(gameObject);
     }
     else if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         suppressOnLoadCall = true;
         Destroy(gameObject);
     }
 }