void RecycleDrumBall(TaiguDrumBall drumBall) { drumBall.IsKeyBall = false; drumBall.transform.parent = m_BallCache.transform; drumBall.transform.localPosition = Vector3.zero; drumBall.gameObject.SetActive(false); TaiguBallType ballType = drumBall.BallType; if (ballType == TaiguBallType.Red) { mUnuseRedBalls.Enqueue(drumBall); } else if (ballType == TaiguBallType.Blue) { mUnuseBlueBalls.Enqueue(drumBall); } else if (ballType == TaiguBallType.RBMix) { mUnuseMixBalls.Enqueue(drumBall); } else if (ballType == TaiguBallType.HoldBegin) { mUnuseHoldBalls.Enqueue(drumBall); } else { if (drumBall != null) { Destroy(drumBall.gameObject); } } }
void PlayHitAniSuper(TaiguBallType ballType, BeatResultRank beatRank) { ParticleSystem curPs = null; if (beatRank == BeatResultRank.Miss || beatRank == BeatResultRank.None) { curPs = m_psMiss; } else { if (ballType == TaiguBallType.Red) { curPs = m_psRed; } else if (ballType == TaiguBallType.Blue) { curPs = m_psBlue; } else if (ballType == TaiguBallType.RBMix) { curPs = m_psMix; } else if (ballType == TaiguBallType.HoldBegin) { curPs = m_psYellow; } } if (curPs != null) { curPs.gameObject.SetActive(true); curPs.Stop(); curPs.Play(); } }
bool IsBeatValid(TaiguBallType ballType, TaiguBeatType beatType) { if (ballType == TaiguBallType.Red && beatType == TaiguBeatType.Left) { return(true); } if (ballType == TaiguBallType.Blue && beatType == TaiguBeatType.Right) { return(true); } if (ballType == TaiguBallType.RBMix && beatType == TaiguBeatType.LRMix) { return(true); } if (ballType == TaiguBallType.HoldBegin && (beatType == TaiguBeatType.Left || beatType == TaiguBeatType.Right || beatType == TaiguBeatType.LRMix) && m_headRank != BeatResultRank.Miss) { return(true); } return(false); }
void AddRoundBall(float ftime, TaiguBallType ballType, bool keyBall, float nTimeSpace) { TimeLineElement tle = new TimeLineElement(); tle.m_functionName = "OnRoundBall"; tle.m_Time = ftime; tle.pushParam(ballType); tle.pushParam(keyBall); tle.pushParam(nTimeSpace); AddEvent(tle); }
void OnRoundBall(TimeLineElement tle) { TaiguBallType ballType = (TaiguBallType)tle.GetParamByIndex(0); bool isKeyBall = (bool)tle.GetParamByIndex(1); float nKeyTimeSpace = (float)tle.GetParamByIndex(2); TaiguDrumBall drumBall = ObtainDrumBall(ballType, nKeyTimeSpace); drumBall.IsKeyBall = isKeyBall; Vector3 v = drumBall.transform.localPosition; v.x = -1 * tle.m_Time * mBallSpeed * 240.0f; drumBall.transform.localPosition = v; mUsingBalls.Enqueue(drumBall); }
void PlayHitAniNormal(TaiguBallType ballType, Vector3 hitPos) { _HideHitAniNormal(); if (ballType == TaiguBallType.Red) { mPlayingDrumAni = m_HitRedAni; } else if (ballType == TaiguBallType.Blue) { mPlayingDrumAni = m_HitBlueAni; } else if (ballType == TaiguBallType.RBMix) { mPlayingDrumAni = m_HitMixAni; } mPlayingDrumAni.gameObject.SetActive(true); mPlayingDrumAni.transform.position = hitPos; mPlayingDrumAni.Play(); }
private BeatResultRank HandleBeat(bool isValid, float checkOffset, BeatResultRank headRank, bool isEnd) { BeatResultRank curHeadRank = BeatResultRank.None; TaiguDrumBall drumBall = null; if (isEnd) { drumBall = mUsingBalls.Dequeue(); } else { drumBall = mUsingBalls.Peek(); } bool isKeyBall = drumBall.IsKeyBall; TaiguBallType ballType = drumBall.BallType; Vector3 ballPos = drumBall.transform.position; #if !MODE_ALLCOMBO if (isValid) { if (isEnd) { headRank = BeatResultRank.None; } curHeadRank = mBeatResult.AddBeatCheck(checkOffset, headRank); } else { mBeatResult.AddBeatMiss(); curHeadRank = BeatResultRank.Miss; } PlayHitAniNormal(ballType, ballPos); #else if (RoomData.IsPlaySuperMode) { PlayHitAniSuper(ballType, curHeadRank); } else { PlayHitAniNormal(ballType, ballPos); } mBeatResult.AddBeatCheck(0, BeatResultRank.None); #endif ///m_Match.HandleBeatMark(mRoundIndex, mBeatResult.LatestBeatMark, mBeatResult.ComnoCount); SendMessage("OnBeatResult", (BeatResultRank)mBeatResult.LatestBeatRank.Value, SendMessageOptions.RequireReceiver); SendMessage("OnBeatCombo", mBeatResult.ComnoCount.Value, SendMessageOptions.DontRequireReceiver); if (isEnd) { if (isKeyBall) { ///m_Match.HandleRoundMark(mRoundIndex, mBeatResult.LatestRoundMark, mBeatResult.LatestBeatRank, mBeatResult.LatestRoundRank); ++mRoundIndex; mBeatResult.StartNewRound(); } RecycleDrumBall(drumBall); } return(curHeadRank); }
TaiguDrumBall ObtainDrumBall(TaiguBallType ballType, float nKeyTimeSpace) { TaiguDrumBall drumBall = null; switch (ballType) { case TaiguBallType.Red: if (mUnuseRedBalls.Count > 0) { drumBall = mUnuseRedBalls.Dequeue(); drumBall.gameObject.SetActive(true); } else { drumBall = CreateRedBall(); } break; case TaiguBallType.Blue: if (mUnuseBlueBalls.Count > 0) { drumBall = mUnuseBlueBalls.Dequeue(); drumBall.gameObject.SetActive(true); } else { drumBall = CreateBlueBall(); } break; case TaiguBallType.RBMix: if (mUnuseMixBalls.Count > 0) { drumBall = mUnuseMixBalls.Dequeue(); drumBall.gameObject.SetActive(true); } else { drumBall = CreateMixBall(); } break; case TaiguBallType.HoldBegin: if (mUnuseHoldBalls.Count > 0) { drumBall = mUnuseHoldBalls.Dequeue(); drumBall.ResizeHoldBall(nKeyTimeSpace * mBallSpeed * 240.0f); drumBall.gameObject.SetActive(true); } else { drumBall = CreateHoldBall(nKeyTimeSpace); } break; } Vector3 pos = m_BallCaptain.transform.position; pos.x = m_BeginPos.position.x; pos.z += mBallDepth * 0.001f; drumBall.transform.parent = m_BallCaptain.transform; drumBall.transform.localScale = Vector3.one; drumBall.transform.position = pos; mBallDepth++; return(drumBall); }