private void NotifyPromptListeners(RhythmCore.RhythmExpectedEventInfo eventInfo) { //Debug.Log("PROMPT"); foreach (IRhythmPromptListener listenerComponent in this.promptListeners) { listenerComponent.PromptNotify(eventInfo); } }
public RhythmCore.RhythmExpectedEventInfo GenerateExpectedEvent_A(MutexArrowNoRepeatStrat_A strat) { RhythmCore.RhythmExpectedEventInfo ret; if (strat == this._genStratA) { // Generate a non-repeating prompt arrow direction this.currInfoA = RandomArrowGenStrat.GenerateExpectedEventStatic(); if (_myState == State.WAITING_FOR_FIRST) { while (this.currInfoA.expectedKey == this.prevInfoA.expectedKey) { this.currInfoA = RandomArrowGenStrat.GenerateExpectedEventStatic(); } this._myState = State.A_REQUESTED_B_PENDING; //Debug.Log("GenerateExpectedEvent_A -> A_REQUESTED_B_PENDING"); } else if (_myState == State.B_REQUESTED_A_PENDING) { while (this.currInfoA.expectedKey == this.prevInfoA.expectedKey || this.currInfoA.expectedKey == this.currInfoB.expectedKey) { this.currInfoA = RandomArrowGenStrat.GenerateExpectedEventStatic(); } this._myState = State.WAITING_FOR_FIRST; //Debug.Log("GenerateExpectedEvent_A -> WAITING_FOR_FIRST"); } else { Debug.LogError("Invalid state in MutexArrowCoordinator.GenerateExpectedEvent_A"); } // Set this.prevInfo to track the previous key this strategy generated this.prevInfoA = this.currInfoA; // Return ret = this.currInfoA; } else { Debug.LogError("MutexArrowNoRepeatStrat_A passed into GenerateExpectedEvent_A does not match registered strategy"); ret = new RhythmCore.RhythmExpectedEventInfo() { expectedKey = KeyCode.A }; } return(ret); }
public static RhythmCore.RhythmExpectedEventInfo GenerateExpectedEventStatic(ref RhythmCore.RhythmExpectedEventInfo prev) { // Generate a non-repeating prompt arrow direction RhythmCore.RhythmExpectedEventInfo retInfo = RandomArrowGenStrat.GenerateExpectedEventStatic(); while (retInfo.expectedKey == prev.expectedKey) { retInfo = RandomArrowGenStrat.GenerateExpectedEventStatic(); } // Set this.prevInfo to track the previous key this strategy generated prev = retInfo; // Return return(retInfo); }
public void PromptNotify(RhythmCore.RhythmExpectedEventInfo eventInfo) { // Do something when a beat is queued up (we enter a beat window) //Debug.Log("Prompt"); this.ResetPosition(); Vector3 offset = new Vector3(0.0f, 0.0f, -16.0f); switch (eventInfo.expectedKey) { case KeyCode.UpArrow: { offset = this.uOffset; break; } case KeyCode.DownArrow: { offset = this.dOffset; break; } case KeyCode.LeftArrow: { offset = this.lOffset; break; } case KeyCode.RightArrow: { offset = this.rOffset; break; } default: { Debug.LogError("Unexpected eventInfo.expectedKey value in TestRhythmCube.EventQueuedNotify"); break; } } this.transform.position += offset; }
public void PromptNotify(RhythmCore.RhythmExpectedEventInfo eventInfo) { // Do nothing }
public void PromptNotify(RhythmCore.RhythmExpectedEventInfo eventInfo) { // Do something when a beat is queued up (we enter a beat window) TurnArrow(MGDirectionUtils.DirectionFromKey(eventInfo.expectedKey)); }