Ordering Cats System
Customer cats that sit at tables, order items, and must be served.
Key Classes
OrderingCat
Location: Assets/_Game/Scripts/OrderingCat.cs
The in-game customer entity:
public class OrderingCat : MonoBehaviour, ITriggerHandler, IEffectTarget{ public CatData CatData; public OrderData OrderData; public CatOrderState CurrentLogicalState;
public event Action<OrderingCat> OnOrderCompleted; public event Action<OrderingCat> OnOrderIncorrect; public event Action<OrderingCat> OnOrderTimedOut;}CatOrderState
public enum CatOrderState{ Entering, // Walking to table Ordering, // Waiting for food Completed, // Order fulfilled Failed // Timed out or left}CatData
Location: Assets/_Game/Scripts/Data/CatData.cs
ScriptableObject for cat types:
| Property | Description |
|---|---|
catName | Display name |
personality | Regular, Patient, Impatient, Angry, Joyful |
baseOrderTime | Time before leaving (patience) |
scoreMultiplier | Bonus for serving this type |
patBoostTime | Time added when patted |
maxPatsAmount | Maximum pats allowed |
catMaterial | Visual appearance |
clothingConfig | Clothing items |
OrderData
Location: Assets/_Game/Scripts/Data/OrderData.cs
What the cat wants:
public class OrderData{ public List<OrderItem> items;
public bool IsComplete { get; } public bool NeedsCake(string cakeId, CakeDatabase db); public void DeliverItem(string cakeId, CakeDatabase db); public int GetPrice();}CatSpawnManager
Location: Assets/_Game/Scripts/Managers/CatSpawnManager.cs
Controls cat spawning and table management:
| Method | Purpose |
|---|---|
CheckCatSpawning() | Main spawn loop (called in Update) |
ConfigureTablesForLevel() | Set active positions |
ClearAllCats() | Remove all cats with animation |
DestroyAllCatsImmediately() | Instant removal |
Unique Ordering Cats
Location: Assets/_Game/Scripts/Systems/UniqueOrderingCats/
Special cats with unique behaviors:
UniqueOrderingCatData
Extended cat data with special properties:
public class UniqueOrderingCatData : CatData{ public ClipTransition[] uniqueIdleAnimations; public bool HasUniqueIdleAnimations; // Special behavior configuration}Behavior System
public interface IUniqueOrderingCatBehavior{ void OnCatSpawned(OrderingCat cat); void OnOrderCompleted(OrderingCat cat); float ModifyScore(float baseScore);}Examples:
- Tomeow - 1.5x score multiplier
- Catrina - 2x score + bonus effect
Order Flow
1. CatSpawnManager spawns cat at table position2. OrderData generated from level config3. Cat enters Ordering state, timer starts4. Player drags cake to cat trigger area5. OrderingCat.HandleTriggerEnter() processes delivery6. If correct: item marked delivered, score awarded7. If complete: OnOrderCompleted fires, cat leaves happy8. If wrong: OnOrderIncorrect fires, cat shows disappointed9. If timer expires: OnOrderTimedOut fires, cat leaves sadPatience System
Patience decreases over time. Visual warnings:
| Threshold | Behavior |
|---|---|
| 80% remaining | Pat trigger appears |
| 50% remaining | Thought bubble pulses (caution) |
| 20% remaining | Full danger pulse, heartbeat sound |
Patting adds time (up to maxPatsAmount times).
Animations (Animancer)
OrderingCat uses Animancer for animations:
[SerializeField] private ClipTransition[] _idleAnimations;[SerializeField] private ClipTransition _greetingAnimation;[SerializeField] private ClipTransition _pattedAnimation;[SerializeField] private ClipTransition _eatingAnimation;[SerializeField] private ClipTransition _disappointedAnimation;[SerializeField] private ClipTransition _happyOrderFulfilledAnimation;Clothing System
Location: Assets/_Game/Scripts/Data/CatClothingConfig.cs
Cats can wear clothing via CatClothingHandler:
if (clothingHandler != null && catData.clothingConfig.HasAnyClothing()){ clothingHandler.ApplyClothingConfig(catData.clothingConfig);}