/// <summary> /// Initializes the MessageBox: gets all necessary components /// and creates the icon which corresponds to the type of the MessageBox /// </summary> void Start() { btn = button.GetComponent <GaMRButton>(); tagalongScript = GetComponent <SimpleTagalong>(); btn.OnPressed = Accept; if (type == MessageBoxType.ERROR) { Instantiate(Resources.Load("Animated Error"), iconPosition.position, Quaternion.identity, iconPosition); } else if (type == MessageBoxType.SUCCESS) { Instantiate(Resources.Load("Animated Success"), iconPosition.position, Quaternion.identity, iconPosition); } else if (type == MessageBoxType.WARNING) { Instantiate(Resources.Load("Animated Warning"), iconPosition.position, Quaternion.identity, iconPosition); } else if (type == MessageBoxType.INFORMATION) { Instantiate(Resources.Load("Animated Info"), iconPosition.position, Quaternion.identity, iconPosition); } tagalongScript.TagalongDistance = 1.7f + 0.1f * count; }
private void ChangeLanguage(GaMRButton sender) { InformationManager.Instance.Language = (Language)sender.Data; if (OnCloseAction != null) { OnCloseAction(); } Destroy(gameObject); }
/// <summary> /// initializes the annotation box /// assigns all buttons /// fills it with the text of the annotation /// </summary> void Start() { buttonEdit = editButton.GetComponent <GaMRButton>(); buttonDelete = deleteButton.GetComponent <GaMRButton>(); buttonClose = closeButton.GetComponent <GaMRButton>(); caption = textField.GetComponent <Caption>(); // necessary since caption has not yet called Start() but is needed immediately caption.Init(); caption.Text = container.Annotation.Text; buttonEdit.OnPressed = EditText; buttonDelete.OnPressed = DeleteAnnotation; buttonClose.OnPressed = Close; }
private void OnQuestionSelected(GaMRButton sender) { int nButton = questionSelected - startIndex; if (nButton >= 0 && nButton < buttons.Count) { buttons[nButton].ButtonChecked = false; } questionSelected = sender.Data; ((FocusableCheckButton)sender).ButtonChecked = true; if (quizManager.PositionToName) { quizManager.EvaluateQuestion(quizManager.Annotations[questionSelected].Text); } else { quizManager.CurrentlySelectedName = quizManager.Annotations[questionSelected].Text; } }
private void OnQuizSelected(GaMRButton sender) { quizSelected = sender.Data; Close(); }
private void ClickText4(GaMRButton sender) { ClickedText(4); }
private void ClickText3(GaMRButton sender) { ClickedText(3); }
private void ClickText2(GaMRButton sender) { ClickedText(2); }
private void ClickText1(GaMRButton sender) { ClickedText(1); }
private void ClickText0(GaMRButton sender) { ClickedText(0); }