Ejemplo n.º 1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != null)
     {
         ErrorLogger.LogErrorInFile("Error in " + this.name);
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != null)
        {
            ErrorLogger.LogErrorInFile("Error in " + this.name);
            Destroy(gameObject);
        }

        button = this.gameObject.GetComponent <Button>();
        label  = this.gameObject.GetComponentInChildren <TextMeshProUGUI>();
        button.onClick.AddListener(DoStoredEvent);
    }