Cleaning a bit

This commit is contained in:
2026-01-14 19:37:37 +01:00
parent 65b153f97d
commit 4922a91a04
6 changed files with 34 additions and 46 deletions

View File

@@ -1,14 +1,15 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDKBase;
using VRC.Udon;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
namespace Marro.PacManUdon
{
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))]
[RequireComponent(typeof(Collider))]
public class BonusFruit : UdonSharpBehaviour
{
[SerializeField, UdonSynced, FieldChangeCallback(nameof(FruitType))] PacManFruitType fruitType;
PacManFruitType fruitType;
Animator animator;
new Renderer renderer;
@@ -67,7 +68,6 @@
this.fruitType = fruitType;
value = (int)fruitScoreValue[PacManConstants.FruitTypeToValue(fruitType)];
animator.SetFloat("FruitType", PacManConstants.FruitTypeToValue(fruitType));
RequestSerialization();
}
public void SetFrozen(bool frozen)
@@ -80,7 +80,6 @@
renderer.enabled = active;
collider.enabled = active;
this.active = active;
RequestSerialization();
}
public PacManFruitType FruitType
@@ -101,18 +100,17 @@
get => active;
}
private DataDictionary fruitScoreValue = new DataDictionary()
{
{(int)PacManFruitType.None , 0},
{(int)PacManFruitType.Cherries , 100},
{(int)PacManFruitType.Strawberry, 300},
{(int)PacManFruitType.Peach , 500},
{(int)PacManFruitType.Apple , 700},
{(int)PacManFruitType.Grapes , 1000},
{(int)PacManFruitType.Galaxian , 2000},
{(int)PacManFruitType.Bell , 3000},
{(int)PacManFruitType.Key , 5000}
};
private readonly DataDictionary fruitScoreValue = new DataDictionary()
{
{(int)PacManFruitType.None , 0},
{(int)PacManFruitType.Cherries , 100},
{(int)PacManFruitType.Strawberry, 300},
{(int)PacManFruitType.Peach , 500},
{(int)PacManFruitType.Apple , 700},
{(int)PacManFruitType.Grapes , 1000},
{(int)PacManFruitType.Galaxian , 2000},
{(int)PacManFruitType.Bell , 3000},
{(int)PacManFruitType.Key , 5000}
};
}
}