InteractableHandlerInitializer - jimdroberts/FishMMO GitHub Wiki
InteractableHandlerInitializer
is a ScriptableObject initializer for registering interactable handlers in the FishMMO server. It implements the handler registration interface and centralizes the registration logic for all interactable types.
-
public void RegisterHandlers()
Registers all interactable handlers with the InteractableSystem.
- Create an instance of
InteractableHandlerInitializer
as a ScriptableObject in your project. - Call
RegisterHandlers
during server initialization to register all interactable handlers.
// Example 1: Registering interactable handlers
interactableHandlerInitializer.RegisterHandlers();
- Use this ScriptableObject to centralize and manage handler registration for maintainability.
- Register all necessary handlers before accepting player interactions.
- Update the registration logic as new interactable types are added to the game.