Esempio n. 1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 2
0
    public void PlaceNote(int beatIdx, CombatNote note)
    {
        Debug.Log($"Placing beat: {beatIdx}");
        CombatCoordinator cc = CombatCoordinator.Instance;

        recentBeatIdx = beatIdx;
        int   idx      = (beatIdx + spriteIdx) % beatSprites.Count;
        float progress = (note.Status == 0 ? cc.SongProgress : (cc.SongProgress < note.PlayTime ? cc.SongProgress : (note.LockTime < note.PlayTime ? note.PlayTime : note.LockTime)));

        beatSprites[idx].transform.position = new Vector2(beatStart.position.x,
                                                          ((1 - (note.PlayTime - progress) / cc.noteTrackPeriod) * (goalHeight - startHeight)) + startHeight);
        beatSprites[idx].SetSprite(note);
    }