static void CreateWizard() { HudWizard hudWizard = ScriptableWizard.DisplayWizard <HudWizard> ("Create Hud", "Create", "Update"); if (dialogHud != null) { dialogHud = (DialogHud)((GameObject)GameObject.Find("Dialog-Hud")).GetComponent <DialogHud> (); hudWizard.backgroundTexture = dialogHud.background.sprite; hudWizard.characterTexture = dialogHud.character.sprite; hudWizard.showCharacterName = dialogHud.characterNamePanel.active; hudWizard.backgroundColor = dialogHud.background.color; //Dialog components colors hudWizard.dialogColor = dialogHud.dialogPanel.GetComponent <Image>().color; hudWizard.characterNameColor = dialogHud.characterNamePanel.GetComponent <Image>().color; hudWizard.optionsColor = dialogHud.optionPanel.GetComponent <Image>().color; //Current font size hudWizard.characterNameFontSize = dialogHud.characterNamePanel.gameObject.GetComponentInChildren <Text> ().fontSize; hudWizard.dialogFontSize = dialogHud.dialogPanel.gameObject.GetComponentInChildren <Text> ().fontSize; hudWizard.optionsFontSize = dialogHud.optionPanel.gameObject.GetComponentInChildren <Text> ().fontSize; //Current font type hudWizard.characterNameFont = dialogHud.characterNamePanel.gameObject.GetComponentInChildren <Text> ().font; hudWizard.dialogFont = dialogHud.dialogPanel.gameObject.GetComponentInChildren <Text> ().font; hudWizard.optionsFont = dialogHud.optionPanel.gameObject.GetComponentInChildren <Text> ().font; } }
void OnWizardOtherButton() { if (dialogHud == null && GameObject.Find("Dialog-Hud")) { dialogHud = (DialogHud)((GameObject)GameObject.Find("Dialog-Hud")).GetComponent <DialogHud> (); } dialogHud.background.sprite = backgroundTexture; dialogHud.character.sprite = characterTexture; UpdateCharacterPosition(); dialogHud.characterNamePanel.SetActive(this.showCharacterName); UpdateSizes(); UpdateFonts(); UpdateColors(); EditorUtility.SetDirty(dialogHud); }
void OnWizardCreate() { if (dialogHud != null) { DestroyImmediate(dialogHud); } dialogHud = (DialogHud)((GameObject)Instantiate(Resources.Load("DialogHud"))).GetComponent <DialogHud>(); dialogHud.name = "Dialog-Hud"; if (backgroundTexture != null) { dialogHud.background.sprite = backgroundTexture; } if (characterTexture != null) { dialogHud.character.sprite = characterTexture; UpdateCharacterPosition(); } dialogHud.characterNamePanel.SetActive(this.showCharacterName); UpdateSizes(); UpdateFonts(); UpdateColors(); }