Tacklesketch
Overview
This component is attached to an entity (typically ausable item like a "Tackle Sketch") and enables players to learn a predefined tackle recipe by calling the Teach method. It tags the entity with "tacklesketch" for identification and cleans up the tag upon removal.
Dependencies & Tags
- Tags added:
"tacklesketch"(during initialization) - Tags removed:
"tacklesketch"(inOnRemoveFromEntity) - Component dependencies: Relies on the target entity having a
craftingstationcomponent (used to learn the recipe) and the source entity supportingGetSpecificSketchPrefab()andGetRecipeName()methods.
Properties
No public properties are explicitly initialized in the constructor or initialization logic. Only the inst reference is stored.
Main Functions
OnRemoveFromEntity()
- Description: Cleans up the
"tacklesketch"tag when the component is removed from its entity (e.g., when the item is destroyed or consumed). - Parameters: None.
Teach(target)
- Description: Grants the player (or other target) the tackle recipe associated with this sketch, triggers a
"onlearnednewtacklesketch"event on the target, and removes the sketch entity entirely. - Parameters:
target(Entity): The entity (usually a player) that will learn the recipe. Must have acraftingstationcomponent.
Events & Listeners
- Listens for: None.
- Triggers:
onlearnednewtacklesketch— pushed on thetargetentity after the recipe is learned.