Skip to content

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:

PropertyDescription
catNameDisplay name
personalityRegular, Patient, Impatient, Angry, Joyful
baseOrderTimeTime before leaving (patience)
scoreMultiplierBonus for serving this type
patBoostTimeTime added when patted
maxPatsAmountMaximum pats allowed
catMaterialVisual appearance
clothingConfigClothing 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:

MethodPurpose
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 position
2. OrderData generated from level config
3. Cat enters Ordering state, timer starts
4. Player drags cake to cat trigger area
5. OrderingCat.HandleTriggerEnter() processes delivery
6. If correct: item marked delivered, score awarded
7. If complete: OnOrderCompleted fires, cat leaves happy
8. If wrong: OnOrderIncorrect fires, cat shows disappointed
9. If timer expires: OnOrderTimedOut fires, cat leaves sad

Patience System

Patience decreases over time. Visual warnings:

ThresholdBehavior
80% remainingPat trigger appears
50% remainingThought bubble pulses (caution)
20% remainingFull 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);
}