public static TipWindowUI Create(Transform parent, TipWindowType type = TipWindowType.oneButton) { var window = Instantiate(LoadResources .Load <TipWindowUI>(UIName.prefab_tipWindow), parent); if (type == TipWindowType.oneButton) { window.twoButton1.gameObject.SetActive(false); window.twoButton2.gameObject.SetActive(false); } else if (type == TipWindowType.twoButton) { window.oneButton1.gameObject.SetActive(false); } return(window); }
private T LoadPrefab <T>(string path) where T : Object { return(LoadResources.Load <T>(path)); }