🐟Fish Catcher

Manages caught fish: spawns, hides, and tracks them using object pooling. Designed to work with animation events and fishing state machines.

Requires: A parent MAnimal (from Malbers Animations) — it uses the left hand bone to hold fish.


🔧 Inspector Settings

  • Fish Count Reference to an IntReference that tracks total fish caught. Automatically incremented when a fish is despawned (e.g., after presentation).

  • Fishing End Presentation Event Triggered when fishing ends and a fish is being presented. Useful for cleanup or UI updates.

  • On Fish Presented Unity event fired when FishPresentation() is called. Hook animations, sounds, or UI here.


📈 Public Methods

  • HandleFishCatched(FishData fishData) Caches or instantiates the fish prefab from the given FishData and prepares it for display (inactive by default).

  • SpawnFish() Activates the current fish in the left hand.

  • DespawnFish() Hides the fish and increments the fish count. Called automatically at the end of a fishing sequence if a fish was presented.

  • FishPresentation() Marks that a fish is being shown (e.g., during a victory pose). Triggers OnFishPresented.

  • HandleFishingEnd() Called externally (e.g., by a state machine) when fishing ends. If a fish was presented, it fires the FishingEndPresentationEvent and despawns the fish.

  • ClearFishPool() Destroys all pooled fish objects. Called automatically on destroy

Last updated