private void TextInput_OnPreviewKeyUp(object sender, KeyEventArgs e) { // if (HintPanel.Visibility == Visibility.Hidden) return; Console.WriteLine("TextInput_OnPreviewKeyUp:{0}", e.Key); var key = e.Key; switch (key) { case Key.Up: HintPanel.LastLine(); goto default; case Key.Down: HintPanel.NextLine(); goto default; case Key.Escape: HintPanel.Visibility = Visibility.Hidden; break; case Key.Enter: PitchOn(HintPanel.Choice()); goto default; default: if (HintPanel.Visibility != Visibility.Visible) { if (string.IsNullOrEmpty(InputBox.Text) == false) { HintPanelShow(); } } break; } }
private void InputBox_OnTextChanged(object sender, TextChangedEventArgs e) { Console.WriteLine("InputBox_OnTextChanged:{0}", e.Changes); var keyStr = InputBox.Text; if (string.IsNullOrEmpty(keyStr)) { HintPanel.Visibility = Visibility.Hidden; return; } HintPanel.RenderResultList(keyStr); }
protected override void Start() { base.Start(); interpol = GetComponent <ColorInterpolator>(); resourceStorage = GameController.instance.player.resources; if (!isCreated) { Expand(currentStorage); isCreated = true; } notification = GameController.instance.buttons.hint; }
public void ShowHint(string text, string title = "Hint") { if (hintPanel != null) { Destroy(hintPanel); } hintPanel = Instantiate(hintPrefab); hintPanel.transform.SetParent(Camera.main.transform.Find("Canvas").gameObject.transform); RectTransform rt = hintPanel.GetComponent <RectTransform>(); rt.anchoredPosition = new Vector2(240, -300); HintPanel panelComponent = hintPanel.GetComponent <HintPanel>(); panelComponent.SetTitle(title); panelComponent.SetText(text); }
// Update is called once per frame void Update() { float CloseDistance = 100000f; int Subject = 0; for (int i = 0; i < Triggers.Length; i++) // i = Counter. { float thisDistance = Vector3.Distance(Triggers[i].transform.position, Player.transform.position); // If current distance is less that close distance, then close distance will be the new current distance. if (thisDistance < CloseDistance) { CloseDistance = thisDistance; Subject = i; } } // Checks if the Player enters the close distance of the Trigger box. if (CloseDistance < TriggerDistance) { if (!isUIDisplaying) { HintPanel.SetActive(true); // If the Player enters this TriggerDistance, then activate Hint Panel from Unity. if (Input.GetKey("e")) { QsAs(Subject); // Call the functions. isUIDisplaying = true; // Calls the boolean. EnableMouse(true); // Enable the mouse. HintPanel.SetActive(false); // Disable the Hint Panel when the Player presses E. } } } // Otherwise, checks if the Player left the close distance. else { HintPanel.SetActive(false); if (isUIDisplaying) { QuestionPanel.SetActive(false); AnswerPanel.SetActive(false); isUIDisplaying = false; EnableMouse(false); } } }
protected override void OnInit(EventArgs e) { if (templateContent != null) { ViewSiteControl viewSiteControl = templateContent.ViewSiteControl as ViewSiteControl; if (viewSiteControl != null) { XafUpdatePanel updatePanel = viewSiteControl.Parent as XafUpdatePanel; if (updatePanel != null) { hintPanel = new HintPanel(); hintPanel.ID = "hintPanel"; updatePanel.Controls.AddAt(0, hintPanel); } } } base.OnInit(e); }
public void showHintBoard() { if (GameStatus == GameStatus.PLAYING || GameStatus == GameStatus.WAITING) { if (PlayerPrefs.GetInt("hintNum", 5) == 0) { UseHint.interactable = false; } if (PlayerPrefs.GetInt("totalStar", 0) < 10) { BuyHint.interactable = false; } HintNumTxt.text = PlayerPrefs.GetInt("hintNum", 5).ToString(); HintPanel.GetComponent <Animator>().SetTrigger("hintIn"); Time.timeScale = 0; GetComponent <AudioSource>().Pause(); } }
private void HintPanelHide() { HintPanel.Visibility = Visibility.Hidden; HintPanel.RenderResultList(null); }