Initial commit
This commit is contained in:
26
Assets/Scripts/LevelDisplay.cs
Normal file
26
Assets/Scripts/LevelDisplay.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user