Пример #1
0
 private void OnBeatTargetVisualDone(BeatTarget target)
 {
     _currentBeatIndex++;
     target.gameObject.SetActive(false);
     if (_currentBeatIndex >= BeatTargets.Count)
     {
         GetComponentInParent <ChunkSystem>().PushPool(this);
     }
 }
Пример #2
0
    private void OnBeatTargetDone(BeatTarget target)
    {
        if (target.IsValid)
        {
            FollowersManager.AddFollowers(target.FollowerValue);
            _validCount++;
        }

        _audio.PlayOneShot(target.IsValid ? _validAudio : _invalidAudio, 1f);
    }
Пример #3
0
    //create the corresponding GUI component - BeatTarget - when called
    public BeatTarget CreateBeatTarget()
    {
        BeatTarget newBeat = null;

        if (m_type == BeatType.Hit)
        {
            newBeat      = HitTarget.Create(this);
            m_beattarget = newBeat;
        }
        else if (m_type == BeatType.Held)
        {
            newBeat      = HoldTarget.Create(this);
            m_beattarget = newBeat;
        }

        return(newBeat);
    }
Пример #4
0
 public void Enqueue(BeatTarget bt)
 {
     upcomingNotes.Enqueue(bt);
 }
Пример #5
0
    // Update is called once per frame
    void Update()
    {
        float   songPos = SongPosition.instance.getSongPos();
        HitType hitType = HitType.UnInit;

        //pop all notes which have been missed
        while (
            upcomingNotes.Count > 0 &&
            (songPos - upcomingNotes.Peek().GetBeatInfo().GetOffset()) > INTERVAL_BAD
            )
        {
            hitType = HitType.Miss;
            SetHitTypeObject(upcomingNotes.Peek().GetBeatInfo().GetLane(), hitType);
            Onload.score.missCombo();
            Onload.health.decHealth(0);
            upcomingNotes.Dequeue();
        }

        if (Input.GetKeyDown(inputKey))
        {
            myRenderer.enabled = true;
            myAudio.Play();

            if (upcomingNotes.Count > 0)
            {
                BeatTarget upcoming = upcomingNotes.Peek();
                if (System.Math.Abs(upcoming.GetBeatInfo().GetOffset() - songPos) <= INTERVAL_GREAT)
                {
                    Onload.score.UpdateScore(SCORE_GREAT);
                    Onload.health.incHealth(0);
                    hitType = HitType.Great;
                    upcoming.DeleteMe();
                    upcomingNotes.Dequeue();
                    myRenderer.sprite    = splatted;
                    transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
                }
                else if (System.Math.Abs(upcoming.GetBeatInfo().GetOffset() - songPos) <= INTERVAL_GOOD)
                {
                    Onload.score.UpdateScore(SCORE_GOOD);
                    Onload.health.incHealth(1);
                    hitType = HitType.Good;
                    upcoming.DeleteMe();
                    upcomingNotes.Dequeue();
                    myRenderer.sprite    = splatted;
                    transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
                }
                else if (System.Math.Abs(upcoming.GetBeatInfo().GetOffset() - songPos) <= INTERVAL_BAD)
                {
                    Onload.score.UpdateScore(SCORE_BAD, 1);
                    Onload.health.decHealth(1);
                    hitType = HitType.Bad;
                    upcoming.DeleteMe();
                    upcomingNotes.Dequeue();
                    myRenderer.sprite    = splatted;
                    transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
                }
                SetHitTypeObject(upcoming.GetBeatInfo().GetLane(), hitType);
            }
        }
        if (Input.GetKeyUp(inputKey))
        {
            myRenderer.enabled   = false;
            myRenderer.sprite    = ring;
            transform.localScale = new Vector3(0.06f, 0.06f, 0.06f);
        }
    }
Пример #6
0
 private void Awake()
 {
     _target = GetComponent <BeatTarget>();
 }