void Update() { NoteMover.NoteMove(noteAdd, noteTarget_D, waitTime, gameSpeed, noteHeight, mainAudio.time); FingerActionSelector.TapTrigger(noteAdd, flickJudgeDistance, mainAudio.time); // Debug.LogFormat ("{0}",1f/Time.deltaTime); }
private void getPlayerInput() { if (godMode) { GameObject noteParent = GameObject.FindGameObjectWithTag("NoteParent"); foreach (Transform child in noteParent.transform) { NoteMover note = child.GetComponent <NoteMover> (); if (note.isInZone() && note.isActive) { note.gameObject.GetComponent <ParticleSystem> ().Play(); note.gameObject.GetComponent <SpriteRenderer> ().enabled = false; correctInputs.Enqueue(new PlayerInput(note.inputName)); note.isActive = false; Debug.Log(note.inputName); } } } else { string inputName = ""; bool success = false; if (Input.GetButtonDown("jump")) { inputName = "jump"; midiAnim.SetTrigger("Jump"); } else if (Input.GetButtonDown("duck")) { inputName = "duck"; midiAnim.SetTrigger("Duck"); } else if (Input.GetButtonDown("longjump")) { inputName = "longjump"; midiAnim.SetTrigger("LongJump"); } else if (Input.GetButtonDown("highjump")) { inputName = "highjump"; midiAnim.SetTrigger("HighJump"); } if (inputName != string.Empty) { success = destroyCorrectNote(inputName); if (success) { correctInputs.Enqueue(new PlayerInput(inputName)); } else { Invoke(inputName, inputDelay); } } } }
// Start is called before the first frame update void Start() { LoadNotes(); nmo = GameObject.Find("NoteMover"); mover = nmo.GetComponent <NoteMover>(); GenerateGround(); }
public void SpawnNote(float timeToTarget) { GameObject temp = Instantiate <GameObject>(m_NotePrefab); temp.transform.parent = this.transform; temp.transform.localPosition = Vector3.zero; NoteMover note = temp.GetComponent <NoteMover>(); note.StartPosition = note.transform.position; note.Target = m_Target.position; note.TimeToTarget = timeToTarget; m_Notes.Add(note); }
private bool destroyCorrectNote(string inputName) { bool success = false; GameObject noteParent = GameObject.FindGameObjectWithTag("NoteParent"); foreach (Transform child in noteParent.transform) { NoteMover note = child.GetComponent <NoteMover> (); if (note.isInZone() && note.inputName == inputName && note.isActive) { note.gameObject.GetComponent <ParticleSystem> ().Play(); note.gameObject.GetComponent <SpriteRenderer> ().enabled = false; note.isActive = false; success = true; } } return(success); }
public void Kill(BeatGenerator generator, NoteMover mover) { Object.Destroy(mover.gameObject); generator.NoteList.Dequeue(); NetworkConnector network = GameObject.Find("NetworkManager") .GetComponent<NetworkConnector>(); if(network.LocalPlayer[0]) { GameObject.Find("BattleManager").GetComponent<BattleManager>() .DataQueue[0].Enqueue(new BattleManager.Data{ Id = this.Id, Judge = this.Judge[0], Button = this.PressedButton[0] }); } else { network.SendString('0' + " " + Id.ToString() + " " + PressedButton[0].ToString() + " " + this.Judge[0].ToString()); } if(network.LocalPlayer[1]) { GameObject.Find("BattleManager").GetComponent<BattleManager>() .DataQueue[1].Enqueue(new BattleManager.Data{ Id = this.Id, Judge = this.Judge[1], Button = this.PressedButton[1] }); } else { network.SendString('1' + " " + Id.ToString() + " " + PressedButton[1].ToString() + " " + this.Judge[1].ToString()); } // wait call DoBattle after 100ms BattleManager battleManager = GameObject.Find("BattleManager").GetComponent<BattleManager>(); battleManager.StartCoroutine(battleManager.DoBattle(this.Id)); }
// Start is called before the first frame update void Start() { LoadNotes(); nmo = GameObject.Find("NoteMover"); mover = nmo.GetComponent <NoteMover>(); GenerateGround(); musicObj = GameObject.Find("GameManager"); music = musicObj.GetComponent <AudioSource>(); time = 0; n = 0; Debug.Log(StepData.GetScoreLink); //musicTime = music.clip.length; //leftTime = musicTime - musicObj.GetComponent<AudioSource>().time; //Debug.Log(musicTime); }