/// <summary> /// Initializes the buttons; gets all requires references /// </summary> private void InitializeButtons() { // get/create buttons titleField = transform.Find("Title Button").gameObject.GetComponent <FocusableContentButton>(); commentField = transform.Find("Comment Button").gameObject.GetComponent <FocusableContentButton>(); postOnReqBaz = transform.Find("Post ReqBaz Button").gameObject.GetComponent <FocusableButton>(); closeButton = transform.Find("Close Button").gameObject.GetComponent <FocusableButton>(); // set button actions postOnReqBaz.OnPressed = SubmitToReqBaz; titleField.OnPressed = () => { Keyboard.Display(LocalizationManager.Instance.ResolveString("Enter the feedback title"), title, 50, TitleSet, true); }; commentField.OnPressed = () => { Keyboard.Display(LocalizationManager.Instance.ResolveString("Enter your feedback"), comment, CommentSet, true); }; closeButton.OnPressed = Close; OnUpdateLanguage(); }
private void InitializeButtons() { // get/create buttons englishButton = transform.Find("English Button").gameObject.GetComponent <FocusableContentButton>(); germanButton = transform.Find("German Button").gameObject.GetComponent <FocusableContentButton>(); dutchButton = transform.Find("Dutch Button").gameObject.GetComponent <FocusableContentButton>(); SettingsActions actions = gameObject.AddComponent <SettingsActions>(); // set button data englishButton.Data = (int)Language.ENGLISH; germanButton.Data = (int)Language.GERMAN; dutchButton.Data = (int)Language.DUTCH; OnUpdateLanguage(); // set button actions englishButton.OnButtonPressed = ChangeLanguage; germanButton.OnButtonPressed = ChangeLanguage; dutchButton.OnButtonPressed = ChangeLanguage; }
private void InitializeButtons() { // get/create buttons closeButton = transform.Find("Close Button").gameObject.GetComponent <FocusableButton>(); languageButton = transform.Find("Language Button").gameObject.GetComponent <FocusableContentButton>(); modelServerButton = transform.Find("Model Server Button").gameObject.GetComponent <FocusableContentButton>(); gamificationServerButton = transform.Find("Gamification Server Button").gameObject.GetComponent <FocusableContentButton>(); sharingServerButton = transform.Find("Sharing Server Button").gameObject.GetComponent <FocusableContentButton>(); sharingEnabledButton = transform.Find("Sharing Enabled Button").gameObject.GetComponent <FocusableContentButton>(); collisionButton = transform.Find("Collision Detection Button").gameObject.GetComponent <FocusableContentButton>(); versionLabel = transform.Find("Version Label").gameObject.GetComponent <TextMesh>(); SettingsActions actions = gameObject.AddComponent <SettingsActions>(); // set button actions closeButton.OnPressed = Close; languageButton.OnPressed = ChangeLanguage; modelServerButton.OnPressed = actions.EnterServer; gamificationServerButton.OnPressed = actions.EnterGamificationServer; sharingServerButton.OnPressed = actions.EnterSharingServer; sharingEnabledButton.OnPressed = () => { actions.ToggleSharing(); SetButtonContents(); }; collisionButton.OnPressed = () => { actions.ToggleCollision(); SetButtonContents(); }; OnUpdateLanguage(); // set contents SetButtonContents(); }