private static void Instantiate() { if (Initialized.Task.IsCompleted) { return; } var exitButton = GameObject.Find("ExitGameButton"); if (!exitButton) { return; } _instance = Object.Instantiate(exitButton).DontDestroy(); _instance.SetActive(false); _instance.name = "Button"; _instance.GetComponent <PassiveButton>().OnClick = new UnityEngine.UI.Button.ButtonClickedEvent(); _instance.GetComponent <SceneChanger>().Destroy(); _instance.GetComponent <ConditionalHide>().Destroy(); _instance.GetComponentInChildren <TextTranslatorTMP>().Destroy(); _instance.GetComponentInChildren <TextMeshPro>().text = "Button"; Initialized.SetResult(true); }