namespace Marro.PacManUdon
{
    using UdonSharp;
    using UnityEngine;
    using VRC.SDK3.Data;
    using VRC.SDKBase;
    using VRC.Udon;

    public class LevelDisplay : UdonSharpBehaviour
    {
        Animator[] levelDisplayDigits;

        public void Initialize()
        {
            levelDisplayDigits = GetComponentsInChildren<Animator>();
        }

        public void SetLevel(int level)
        {
            for (int i = 0; i < levelDisplayDigits.Length; i++)
            {
                levelDisplayDigits[i].SetFloat("FruitType", PacManConstants.FruitTypeToValue(PacManConstants.GetFruitTypeForLevel(level - i)));
            }
        }
    }
}
