void on_key_up() { List <MyNote> temp_notes = new List <MyNote>(); SwitchKey key = get_switch_key(); for (int j = 0; j < m_release_notes.Count; ++j) { if ((NoteSide.NoteSide_Left == m_release_notes[j].m_note.m_side && SwitchKey.Left == key) || (NoteSide.NoteSide_Right == m_release_notes[j].m_note.m_side && SwitchKey.Right == key)) { m_release_notes[j].m_is_hit = true; temp_notes.Add(m_release_notes[j]); } } for (int j = 0; j < m_single_notes.Count; ++j) { if ((NoteSide.NoteSide_Left == m_single_notes[j].m_note.m_side && SwitchKey.Left == key) || (NoteSide.NoteSide_Right == m_single_notes[j].m_note.m_side && SwitchKey.Right == key)) { m_single_notes[j].m_is_hit = true; temp_notes.Add(m_single_notes[j]); } } for (int j = 0; j < temp_notes.Count; ++j) { on_hit_note(temp_notes[j]); } }
public SwitchKey get_switch_key() { SwitchKey key = SwitchKey.None; if (Input.GetKey(KeyCode.LeftArrow)) { key = SwitchKey.Left; } else if (Input.GetKey(KeyCode.RightArrow)) { key = SwitchKey.Right; } return(key); }
void Update() { if (null == m_hitbar) { return; } SwitchKey key = m_hitbar.get_switch_key(); if (SwitchKey.Left == key) { on_left_switch_key_pressed(); } else if (SwitchKey.Right == key) { on_right_switch_key_pressed(); } else { on_switch_key_released(); } }
private void OnGUI() { if (ShowAdditionalInfo && !AtLeastOneEnabled) { GUILayoutExtensions.Vertical(() => { GUILayoutExtensions.LabelWithSpace(string.Format("Press {0} key to switch between debug GUI's...", SwitchKey.ToString())); }); } }
private void OnGUI() { if (GUISkin != null) { var labelBoldStyle = GUI.skin.FindStyle("label_bold"); var labelStyle = GUI.skin.FindStyle("label"); var labelImage = GUI.skin.FindStyle("label_image"); if (labelBoldStyle != null) { BoldLabelStyle = labelBoldStyle; } else if (labelStyle != null) { BoldLabelStyle = labelStyle; } if (labelImage != null) { ImageLabelStyle = labelImage; } else if (labelStyle != null) { ImageLabelStyle = labelStyle; } } if (ShowAdditionalInfo && !AtLeastOneEnabled) { GUILayoutExtensions.Vertical(() => { GUILayoutExtensions.LabelWithSpace(string.Format("Press {0} key to switch between debug GUI's...", SwitchKey.ToString())); GUILayoutExtensions.LabelWithSpace(string.Format("Mouse Position: {0}", Input.mousePosition)); }); } }