Пример #1
0
        private void Update()
        {
            int frameIndex = Mathf.FloorToInt(-1 * BlockParent.anchoredPosition.y / (670 * Table.ScopeVal));

            if (frameIndex < 0)
            {
                BlockParent.anchoredPosition = new Vector3(BlockParent.anchoredPosition.x, 0); frameIndex = 0;
            }
            if (frameIndex >= Table.BlockCount())
            {
                BlockParent.anchoredPosition = new Vector3(BlockParent.anchoredPosition.x, (-670 * Table.ScopeVal) * Table.BlockCount() - 0.1f); frameIndex = Table.BlockCount() - 1;
            }
            if (frameIndex != CurrentBlockIndex && frameIndex < Table.BlockCount())
            {
                CurrentBlockIndex = frameIndex;
                if (Table.BlockCount() > 0)
                {
                    CurrentBlockTime = Table.GetBlock(CurrentBlockIndex).BlockTime;
                }
            }
            if (Table.BlockCount() > 0 && CurrentBlockIndex >= 0 && CurrentBlockIndex < Table.BlockCount())
            {
                CalculateCurrentTime();
            }
            if (CurrentTime >= 0 && !IsPlaying)
            {
                MusicSource.time = CurrentTime;
            }
            TimeText.text = Mathf.FloorToInt(CurrentTime / 60).ToString("D2") + ":" + Mathf.FloorToInt(CurrentTime % 60).ToString("D2");

            int y = Mathf.FloorToInt(((Mathf.Abs(BlockParent.anchoredPosition.y) % (670 * Table.ScopeVal)) / (670 * Table.ScopeVal)) * 192);

            if (IsPlaying)
            {
                if (CurrentTime >= 0 && !MusicSource.isPlaying)
                {
                    MusicSource.Play();
                }


                foreach (CreatorNote note in Table.GetBlock(CurrentBlockIndex).GetNoteArray())
                {
                    if ((beforeY <= y && note.YPos > beforeY && note.YPos <= y) || (beforeY > y && note.YPos > (beforeY - 192) && note.YPos <= y))
                    {
                        if (!note.Flick.Equals(0))
                        {
                            FlickSound.Play();
                        }
                        else
                        {
                            TapSound.Play();
                        }
                    }
                }

                BlockParent.anchoredPosition = new Vector3(BlockParent.anchoredPosition.x, BlockParent.anchoredPosition.y - (((670 * Table.ScopeVal) / CurrentBlockTime) * Time.deltaTime));

                if (Mathf.FloorToInt(Mathf.Abs(BlockParent.anchoredPosition.y) / (670 * Table.ScopeVal)) >= Table.BlockCount())
                {
                    StopMusic();
                }
            }
            beforeY = y;
        }
Пример #2
0
        private void DecisionProcess(int DecValue, FlickMode Flick)
        {
            int TweakedDec = DecValue;

            if (!AllowTempestic && DecValue.Equals(5))
            {
                TweakedDec--;
            }

            if (TweakedDec < 3)
            {
                CurCombo = 0;
                ComboValueText.Nuzzle();
                if (HitSound)
                {
                    if (Game.Mode.Equals(GameMode.Starlight))
                    {
                        StarlightBad.Play();
                    }
                    else
                    {
                        TapBadSound.Play();
                    }
                }
            }
            else
            {
                CurCombo += 1;
                ComboValueText.Wake(CurCombo);
                Data.TryUpdateCombo(CurCombo);
                if (HitSound)
                {
                    if (Flick.Equals(FlickMode.None))
                    {
                        if (Game.Mode.Equals(GameMode.Starlight))
                        {
                            StarlightTap.Play();
                        }
                        else
                        {
                            TapSound.Play();
                        }
                    }
                    else
                    {
                        if (Game.Mode.Equals(GameMode.Starlight))
                        {
                            StarlightFlick.Play();
                        }
                        else
                        {
                            FlickSound.Play();
                        }
                    }
                }
            }

            switch (TweakedDec)
            {
            case 0:
                break;

            case 1:
                CalculateScore(0.1f, ComboMultilpier());
                break;

            case 2:
                CalculateScore(0.3f, ComboMultilpier());
                break;

            case 3:
                CalculateScore(0.7f, ComboMultilpier());
                break;

            case 4:
                CalculateScore(1.0f, ComboMultilpier());
                break;

            case 5:
                CalculateScore(1.1f, ComboMultilpier());
                break;
            }
            Data.UpdateNote(TweakedDec);
            DecisionText.Wake(TweakedDec);
        }