public void Awake() { DialogBoxGO = GameObject.Find("Dialog Boxes"); GameObject tempGoObj; tempGoObj = CreateDialogGO("DB_SaveFile", "Save File"); dialogBoxSaveGame = tempGoObj.GetComponent <DialogBoxSaveGame>(); tempGoObj = CreateDialogGO("DB_LoadFile", "Load File"); dialogBoxLoadGame = tempGoObj.GetComponent <DialogBoxLoadGame>(); tempGoObj = CreateDialogGO("DB_Options", "Options"); dialogBoxOptions = tempGoObj.GetComponent <DialogBoxOptions>(); tempGoObj = CreateDialogGO("DB_Settings", "Settings"); dialogBoxSettings = tempGoObj.GetComponent <DialogBoxSettings>(); tempGoObj = CreateDialogGO("DB_Trade", "Trade"); dialogBoxTrade = tempGoObj.GetComponent <DialogBoxTrade>(); tempGoObj = CreateDialogGO("DB_AreYouSure", "Are You Sure"); dialogBoxAreYouSure = tempGoObj.GetComponent <DialogBoxAreYouSure>(); tempGoObj = CreateDialogGO("DB_JobList", "Job List"); dialogBoxJobList = tempGoObj.GetComponent <DialogBoxJobList>(); tempGoObj = CreateDialogGO("DB_Quests", "Quests"); dialogBoxQuests = tempGoObj.GetComponent <DialogBoxQuests>(); AddQuestList(); }
void Awake() { GameObject Controllers = GameObject.Find("Dialog Boxes"); GameObject tempGoObj; mc = GameObject.Find("Dialog Boxes").GetComponent <MenuController>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_SaveFile"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Save File"; dialogBoxSaveGame = tempGoObj.GetComponent <DialogBoxSaveGame>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_LoadFile"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Load File"; dialogBoxLoadGame = tempGoObj.GetComponent <DialogBoxLoadGame>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_Options"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Options"; dialogBoxOptions = tempGoObj.GetComponent <DialogBoxOptions>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_Settings"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Settings"; dialogBoxSettings = tempGoObj.GetComponent <DialogBoxSettings>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_Trade"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Trade"; dialogBoxTrade = tempGoObj.GetComponent <DialogBoxTrade>(); tempGoObj = (GameObject)Instantiate(Resources.Load("UI/DB_AreYouSure"), Controllers.transform.position, Controllers.transform.rotation, Controllers.transform); tempGoObj.name = "Are You Sure"; dialogBoxAreYouSure = tempGoObj.GetComponent <DialogBoxAreYouSure>(); }