Bonus fruit hitbox

This commit is contained in:
2026-06-15 17:21:16 +02:00
parent c601dda10a
commit a24f237bd5
11 changed files with 439 additions and 294 deletions

View File

@@ -6,14 +6,12 @@ namespace Marro.PacManUdon
{
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Renderer))]
[RequireComponent(typeof(Collider))]
public class BonusFruit : SyncedObject
{
PacManFruitType fruitType;
Animator animator;
new Renderer renderer;
new Collider collider;
ScoreBonusDisplay scoreBonusDisplay;
[UdonSynced] bool active;
@@ -25,7 +23,6 @@ namespace Marro.PacManUdon
{
animator = GetComponent<Animator>();
renderer = GetComponent<Renderer>();
collider = GetComponent<Collider>();
scoreBonusDisplay = transform.Find("ScoreBonusDisplay").gameObject.GetComponent<ScoreBonusDisplay>();
scoreBonusDisplay.Initialize();
SetActive(false);
@@ -78,7 +75,6 @@ namespace Marro.PacManUdon
void SetActive(bool active)
{ // This replaces GameObject.active, as attempting to update an animator while a gameobject is inactive seems to result in a silent failure
renderer.enabled = active;
collider.enabled = active;
this.active = active;
}