private void Awake() { if (instance == null) { instance = this; } else if (instance != null) { ErrorLogger.LogErrorInFile("Error in " + this.name); Destroy(gameObject); } }
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); }