private IEnumerator DetectBreathMiss() { double currentDspTime = Metronome.currentBeatTime; //0.1 seconds is too fast to process additional inputs... //So we wait a little longer before we check the proper grace window in WasBeatMissed() //Yeah, I don't like it either. double endOfGraceBuffer = Metronome.currentBeatTime + (2 * INPUT_GRACE_BUFFER); //First, wait grace period while (currentDspTime < endOfGraceBuffer) { currentDspTime = AudioSettings.dspTime; yield return(0); } //Then, check to see if the beat was missed. //It's possible the player hit the beat within the grace window before and after the beat, so checks both sides if (this.WasBeatMissed()) { if (BreathingManager.OnMiss != null) { BreathingManager.OnMiss(); } } }
private void BreathSuccess() { this.goodBreathSound.Play(); if (BreathingManager.OnHit != null) { BreathingManager.OnHit(); } }
private void BreathFail() { this.badBreathSound.Play(); if (BreathingManager.OnFail != null) { BreathingManager.OnFail(); } }
// Start is called before the first frame update void Start() { if (!main) { main = this; } //アバターコンポ animLayer_impact = animator.GetLayerIndex("impact Layer"); ikManager = animator.GetComponent <PlayerIKManager>(); breathingManager = animator.GetComponent <BreathingManager>(); //ボールコンポ ballRB = GetComponent <Rigidbody>(); ballCollider = GetComponent <SphereCollider>(); myContacts = GetComponent <ContactManager>(); wireManager = GetComponent <WireManager>(); //IK lookRotation = new GameObject("lookRotation").transform; lookRotation.parent = tAvatar; lookRotation.localPosition = Vector3.zero; lookForward = new GameObject("lookForward").transform; lookForward.parent = lookRotation; lookForward.localPosition = Vector3.forward; //キーバッファ key_B = KeyBufferManager.CreateKey(); key_R1 = KeyBufferManager.CreateKey(); key_L2 = KeyBufferManager.CreateKey(); }