public override void CreateTailConnector() { base.CreateTailConnector(); if (TailToNext != null) { if (Game.IsNoteColored) { TailToNext.Color = new Color32(ColorKey.r, ColorKey.g, ColorKey.b, ColorKey.a); } else { TailToNext.Color = new Color32(255, 255, 0, 255); } if (Mode.Equals(NoteInfo.LongNoteStart)) { TailToNext.SetEndPos(Game.Dispensor.Notes[NextNoteID].StartPos, 0, SizeInPixel * (140f / 100) * 1f / 2); } else if (Mode.Equals(NoteInfo.SlideNoteStart) || Mode.Equals(NoteInfo.SlideNoteCheckpoint)) { TailToNext.SetStartPos(StartPos, 0f, SizeInPixel * (140f / 100) * 1f / 2); TailToNext.SetEndPos(StartPos, 0f, SizeInPixel * (140f / 100) * 1f / 2); } } if (Mode.Equals(NoteInfo.SlideNoteCheckpoint)) { Game.Dispensor.VisibleNoteCount--; } TailCreated = true; }
public override void CreateTailConnector() { base.CreateTailConnector(); if (TailToNext != null) { if (Game.IsNoteColored) { TailToNext.Color = new Color32(ColorKey.r, ColorKey.g, ColorKey.b, 180); } else { TailToNext.Color = new Color32(255, 255, 255, 180); } if (Mode.Equals(NoteInfo.LongNoteStart)) { TailToNext.SetEndPos(Game.Dispensor.Notes[NextNoteID].StartPos, 0, 0); } else if (Mode.Equals(NoteInfo.SlideNoteStart) || Mode.Equals(NoteInfo.SlideNoteCheckpoint)) { TailToNext.SetStartPos(StartPos, 0f, 0); TailToNext.SetEndPos(Game.Dispensor.Notes[NextNoteID].StartPos, 0f, 0); } } TailCreated = true; }
public override void CreateTailConnector() { base.CreateTailConnector(); if (TailToNext != null) { if (Game.IsNoteColored) { TailToNext.Color = new Color32(ColorKey.r, ColorKey.g, ColorKey.b, 180); } else { TailToNext.Color = new Color32(255, 255, 255, 180); } if (Mode.Equals(NoteInfo.LongNoteStart)) { TailToNext.SetEndPos(Game.Dispensor.Notes[NextNoteID].StartPos, 0, 0); } else if (Mode.Equals(NoteInfo.SlideNoteStart) || Mode.Equals(NoteInfo.SlideNoteCheckpoint)) { TailToNext.SetStartPos(StartPos, 0f, 0); TailToNext.SetEndPos(Game.Dispensor.Notes[NextNoteID].StartPos, 0f, 0); } } if (!Flick.Equals(FlickMode.None)) { GameObject MyConnector = Instantiate(Game.BaseConnector) as GameObject; MyConnector.name = "c" + ID.ToString(); ConnectorToNext = MyConnector.GetComponent <ImprovedConnector>(); ConnectorToNext.OwnerID = ID; if (Game.IsNoteColored) { ConnectorToNext.MainRenderer.material.color = new Color32(ColorKey.r, ColorKey.g, ColorKey.b, 180); } ConnectorToNext.EndPos = Game.Dispensor.Notes[NextNoteID].StartPos; ConnectorToNext.EndScale = 0; Game.Dispensor.Notes[NextNoteID].ConnectorsFromPrevious.Add(ConnectorToNext); } TailCreated = true; }
protected override void MovePhase() { base.MovePhase(); if (gameObject.activeSelf) { float ProgressBy100 = CurrentFrame * Speed; float ProgressBy1 = ProgressBy100 / 100; if (!IsHit && (!Mode.Equals(NoteInfo.SlideNoteStart) || (Mode.Equals(NoteInfo.SlideNoteStart) && Game.Frame < ReachFrame))) { float cX = NotePath.GetPlatinumX(StartPos.x, EndPos.x, ProgressBy1); float cY = NotePath.GetPlatinumY(StartPos.y, EndPos.y, ProgressBy1); CurrentPos = new Vector3(cX, cY, CurrentPos.z); Body.anchoredPosition3D = CurrentPos; BeforePos = CurrentPos; } if (!Game.Paused) { if (Mode.Equals(NoteInfo.LongNoteStart) && !IsHit) { TailToNext.SetStartPos(Body.anchoredPosition3D, ProgressBy1, SizeInPixelNext * (140f / 100)); } if ((Mode.Equals(NoteInfo.SlideNoteStart) || Mode.Equals(NoteInfo.SlideNoteCheckpoint) && TailToNext != null)) { TailToNext.SetStartPos(Body.anchoredPosition3D, (Mode.Equals(NoteInfo.SlideNoteStart) && Game.Frame >= ReachFrame) ? 1 : ProgressBy1, SizeInPixelNext * (140f / 100), (Game.Frame - LastSlideReachFrame) / (Game.Dispensor.Notes[NextNoteID].ReachFrame - LastSlideReachFrame)); } if (TailsFromPrevious.Count > 0) { for (int i = 0; i < TailsFromPrevious.Count; i++) { if (TailsFromPrevious[i] != null) { TailsFromPrevious[i].SetEndPos(Body.anchoredPosition3D, CurrentFrame * Speed > 100 ? 1 : ProgressBy1, SizeInPixelPrev * (140f / 100)); } } } } } }
protected void Hit(Vector3 pos, int finger) { if ((Mode.Equals(NoteInfo.LongNoteEnd) || Mode.Equals(NoteInfo.SlideNoteEnd))) { if (!Game.Dispensor.Notes[PreviousTailID].IsHit) { return; } } if ((Mode.Equals(NoteInfo.SlideNoteCheckpoint) || Mode.Equals(NoteInfo.SlideNoteEnd))) { int Count = 0; for (int i = 0; i < PreviousNoteIDs.Count; i++) { if (Game.Dispensor.Notes[PreviousNoteIDs[i]].Mode.Equals(NoteInfo.SlideNoteStart)) { Count++; } } if (Count.Equals(0)) { return; } } if (pos.y < BorderUp && pos.y >= BorderDown && pos.x >= FlickBorderLeft && pos.x < FlickBorderRight && !IsHit) { if (Game.Judger.HitJudge(Game.Mode, Mode, Flick, CurrentFrame, RunningFrames, true)) { TouchedFinger = finger; if (Flick.Equals(FlickMode.None)) { Game.Judger.TapHitted[EndLine] = true; } else { Game.Judger.SetFlickHitted(Flick, EndLine); } IsHit = true; if (!Mode.Equals(NoteInfo.SlideNoteStart)) { gameObject.GetComponent <Image>().color = Color.clear; } Game.ShortEffectPlay(Mathf.RoundToInt(EndLine), SizeInPixel > 150 ? true : false); if (Mode.Equals(NoteInfo.LongNoteEnd)) { Game.Dispensor.Notes[TailsFromPrevious[0].OwnerID].Erase(); } if (Mode.Equals(NoteInfo.LongNoteStart)) { Body.anchoredPosition3D = EndPos; TailToNext.SetStartPos(Body.anchoredPosition3D, 1, SizeInPixel * (140f / 100) * 1); IsSlideHolding = true; OwnAnimator.Play("HoldEffect"); } else if (Mode.Equals(NoteInfo.SlideNoteStart)) { Game.Judger.NoteQueue[EndLine].Remove(ID); IsSlideHolding = true; OwnAnimator.Play("HoldEffect"); if (Game.Frame < ReachFrame) { Body.anchoredPosition3D = EndPos; SlideFrameCalibrator = RunningFrames - CurrentFrame; LastSlideReachFrame = Game.Frame; } } else { Erase(); } } } }
protected override void MovePhase() { base.MovePhase(); if (gameObject.activeSelf) { float ProgressBy100 = CurrentFrame * Speed; float ProgressBy1 = ProgressBy100 / 100; if (!IsHit && (!Mode.Equals(NoteInfo.SlideNoteStart) || (Mode.Equals(NoteInfo.SlideNoteStart) && Game.Frame < ReachFrame))) { float cX = NotePath.GetStarlightX(StartPos.x, EndPos.x, ProgressBy1); float cY = NotePath.GetStarlightY(ProgressBy100); CurrentPos = new Vector3(cX, cY, CurrentPos.z); Body.anchoredPosition3D = CurrentPos; Body.localScale = new Vector3(NotePath.GetStarlightScale(ProgressBy1), NotePath.GetStarlightScale(ProgressBy1), 1); BeforePos = CurrentPos; } else if (Mode.Equals(NoteInfo.SlideNoteStart) && !Game.Paused && (IsHit || Game.Frame >= ReachFrame)) { Body.anchoredPosition3D += new Vector3(((Game.Dispensor.Notes[NextNoteID].EndPos.x - EndPos.x) / ((SlideFrameDistance + SlideFrameCalibrator) / 60)) * Time.deltaTime, 0); if (IsHit) { FlickBorderLeft = Body.anchoredPosition3D.x - 98; FlickBorderRight = Body.anchoredPosition3D.x + 98; } } if (!Game.Paused) { if (!Flick.Equals(FlickMode.None) && ConnectorToNext != null && ConnectorToNext.gameObject.activeSelf) { ConnectorToNext.StartPos = Body.anchoredPosition3D; ConnectorToNext.StartScale = Body.localScale.x * 120; } if (!Flick.Equals(FlickMode.None) && ConnectorsFromPrevious.Count > 0) { for (int i = 0; i < ConnectorsFromPrevious.Count; i++) { if (ConnectorsFromPrevious[i] != null && !Game.Dispensor.Notes[ConnectorsFromPrevious[i].OwnerID].IsHit) { ConnectorsFromPrevious[i].EndPos = Body.anchoredPosition3D; ConnectorsFromPrevious[i].EndScale = Body.localScale.x * 120; } if (ConnectorsFromPrevious[i] != null && Game.Dispensor.Notes[ConnectorsFromPrevious[i].OwnerID].IsHit) { ConnectorsFromPrevious[i].gameObject.SetActive(false); } } } if (Mode.Equals(NoteInfo.LongNoteStart) && !IsHit) { TailToNext.SetStartPos(Body.anchoredPosition3D, ProgressBy1, SizeInPixel * (140f / 100)); } if ((Mode.Equals(NoteInfo.SlideNoteStart) || Mode.Equals(NoteInfo.SlideNoteCheckpoint) && TailToNext != null)) { TailToNext.SetStartPos(Body.anchoredPosition3D, (Mode.Equals(NoteInfo.SlideNoteStart) && Game.Frame >= ReachFrame) ? 1 : ProgressBy1, SizeInPixel * (140f / 100), (Game.Frame - LastSlideReachFrame) / (Game.Dispensor.Notes[NextNoteID].ReachFrame - LastSlideReachFrame)); } if (TailsFromPrevious.Count > 0) { for (int i = 0; i < TailsFromPrevious.Count; i++) { if (TailsFromPrevious[i] != null) { TailsFromPrevious[i].SetEndPos(Body.anchoredPosition3D, CurrentFrame * Speed > 100 ? 1 : ProgressBy1, SizeInPixel * (140f / 100)); } } } } } }
protected override void MovePhase() { base.MovePhase(); if (gameObject.activeSelf) { float ProgressBy100 = CurrentFrame * Speed; float ProgressBy1 = ProgressBy100 / 100; if (!IsHit && (!Mode.Equals(NoteInfo.SlideNoteStart) || (Mode.Equals(NoteInfo.SlideNoteStart) && Game.Frame < ReachFrame))) { if (Game.Mode.Equals(GameMode.Theater2P)) { float cX = NotePath.GetTheaterX(StartPos.x, EndPos.x, ProgressBy1); float cY = NotePath.GetTheaterPortY(ProgressBy100); CurrentPos = new Vector3(cX, cY, CurrentPos.z); Body.anchoredPosition3D = CurrentPos; Body.localScale = new Vector3(NotePath.GetTheaterScale(ProgressBy1), NotePath.GetTheaterScale(ProgressBy1), 1); } else { float cX = NotePath.GetTheaterX(StartPos.x, EndPos.x, ProgressBy1); float cY = NotePath.GetTheaterY(ProgressBy100); CurrentPos = new Vector3(cX, cY, CurrentPos.z); Body.anchoredPosition3D = CurrentPos; Body.localScale = new Vector3(NotePath.GetTheaterScale(ProgressBy1), NotePath.GetTheaterScale(ProgressBy1), 1); } BeforePos = CurrentPos; } else if (Mode.Equals(NoteInfo.SlideNoteStart) && !Game.Paused && (IsHit || Game.Frame >= ReachFrame)) { Body.anchoredPosition3D += new Vector3(((Game.Dispensor.Notes[NextNoteID].EndPos.x - EndPos.x) / ((SlideFrameDistance + SlideFrameCalibrator) / 60)) * Time.deltaTime, 0); if (IsHit) { FlickBorderLeft = Body.anchoredPosition3D.x - 79; FlickBorderRight = Body.anchoredPosition3D.x + 79; } } if (!Game.Paused) { if (Mode.Equals(NoteInfo.LongNoteStart) && !IsHit) { TailToNext.SetStartPos(Body.anchoredPosition3D, ProgressBy1, SizeInPixelNext * (140f / 100)); } if ((Mode.Equals(NoteInfo.SlideNoteStart) || Mode.Equals(NoteInfo.SlideNoteCheckpoint) && TailToNext != null)) { TailToNext.SetStartPos(Body.anchoredPosition3D, (Mode.Equals(NoteInfo.SlideNoteStart) && Game.Frame >= ReachFrame) ? 1 : ProgressBy1, SizeInPixelNext * (140f / 100), (Game.Frame - LastSlideReachFrame) / (Game.Dispensor.Notes[NextNoteID].ReachFrame - LastSlideReachFrame)); if (!Game.Dispensor.Notes[NextNoteID].IsAppeared) { TailToNext.SetDeltaEndPos((Game.Dispensor.Notes[NextNoteID].StartPos - StartPos) / (SlideFrameDistance + SlideFrameCalibrator), 0, SizeInPixelNext * (140f / 100), (Game.Frame - LastSlideAppearFrame) / (Game.Dispensor.Notes[NextNoteID].AppearFrame - LastSlideAppearFrame)); } } if (TailsFromPrevious.Count > 0) { for (int i = 0; i < TailsFromPrevious.Count; i++) { if (TailsFromPrevious[i] != null) { TailsFromPrevious[i].SetEndPos(Body.anchoredPosition3D, CurrentFrame * Speed > 100 ? 1 : ProgressBy1, SizeInPixelPrev * (140f / 100)); } } } } } }