// Retun false if not hit, retun true if hit public override bool CheckHit(InputRow currentInput) { InputNote inputNote = null; switch (trickType) { case TrickType.A: inputNote = currentInput.noteA; break; case TrickType.B: inputNote = currentInput.noteB; break; } // Cancel if Null if (inputNote == null) { return(false); } // Destroy Self if hit, just pressed if (inputNote.GetJustPressed()) { Destroy(gameObject); } return(true); }
private void bntEdit_Click(object sender, RoutedEventArgs e) { int index; StockInDetails r = new StockInDetails(); DependencyObject dep = (DependencyObject)e.OriginalSource; while ((dep != null) && !(dep is ListViewItem)) { dep = VisualTreeHelper.GetParent(dep); } if (dep == null) { return; } index = lvDataStockIn.ItemContainerGenerator.IndexFromContainer(dep); InputNote inputNote = new InputNote(_stockInDetailsList[index].Note); if ((_stockInDetailsList[index].Note == null || _stockInDetailsList[index].Note.Equals("") || _stockInDetailsList[index].Note.Equals(inputNote.Note))) { if (inputNote.ShowDialog() == true) { r.Note = inputNote.Note; r.Sto_id = _stockInDetailsList[index].Sto_id; r.Quan = _stockInDetailsList[index].Quan; r.ItemPrice = _stockInDetailsList[index].ItemPrice; _stockInDetailsList[index] = r; } } else { inputNote.ShowDialog(); } lvDataStockIn.Items.Refresh(); }
private void UpdateQueue() { for (int i = 0; i < LevelController.NUMBER_OF_PLAYERS; i++) { InputNote[] currentPlayerNotes = LevelController.Instance.playerNotes[i].ToArray(); for (int j = 0; j < LevelController.NUMBER_OF_INITIAL_NOTES; j++) { InputNote currentPlayerNote = currentPlayerNotes[j]; playersButtons[i].images[j].sprite = _buttonSpritesDictionary[currentPlayerNote]; } } }
public void OnInputClicked(InputClickedEventData eventData) { if (Time.time - lastTimeOpenedInputNote > minTimeDiffToSetMarkerInSec) { lastTimeOpenedInputNote = Time.time; GameObject inputNoteGO = Instantiate(inputNotePrefab); currentInputNote = inputNoteGO.GetComponent <InputNote>(); NoteDictationInputField inputField = inputNoteGO.GetComponentInChildren <NoteDictationInputField>(); inputField.idList = idList; inputField.opener = this; currentInputNote.confirmButton.receiver = inputField; currentInputNote.cancelButton.receiver = inputField; inputField.capturer = currentInputNote.capturer; } }
// Retun false if not hit, retun true if hit public override bool CheckHit(InputRow currentInput) { InputNote inputNote = null; switch (noteType) { case NoteType.LEFT: inputNote = currentInput.noteLeft; break; case NoteType.DOWN: inputNote = currentInput.noteDown; break; case NoteType.UP: inputNote = currentInput.noteUp; break; case NoteType.RIGHT: inputNote = currentInput.noteRight; break; } // Cancel if Null if (inputNote == null) { return(false); } // Destroy Self if hit, just pressed if (inputNote.GetJustPressed()) { Destroy(gameObject); } return(true); }
public void OnNoteInput(int playerNumber, InputNote note) { print("player " + playerNumber + " pressed " + note); if (_ignoreInput[playerNumber]) { return; } _ignoreInput[playerNumber] = true; if (AudioController.Instance.IsInAcceptZone()) { _ignoreInput[playerNumber] = true; playerSuccess[playerNumber] = (playerNotes[playerNumber].Peek() == note); } else { ProcessDirectHit(playerNumber); } //update notes queue //UpdateNoteQueue(playerNumber); }
public void StopInputNote() { currentInputNote.CompleteInput(); currentInputNote = null; }
protected override void Awake() { base.Awake(); reactingObject = GetComponent <ContentCreationButton>(); inputNote = GetComponentInParent <InputNote>(); }
private void Start() { inputNote = GetComponentInParent <InputNote>(); cameraOverlay = Camera.main.GetComponentInChildren <CameraOverlay>(); cameraOverlay.Capturer = this; }