AbilityCrafter - jimdroberts/FishMMO GitHub Wiki

Description

Represents an ability crafter NPC that allows players to craft or modify abilities. Inherits from Interactable. Displays a custom title and color in the UI.


API Access

Properties

  • public override string Title { get; }

    The display title for the ability crafter, shown in the UI.

  • public override Color TitleColor { get; }

    The color of the title displayed for the ability crafter in the UI. Uses a lavender color for distinction.


Basic Usage

Setup

  1. Attach the AbilityCrafter component to an NPC GameObject in your scene.
  2. Ensure the GameObject also has a SceneObjectNamer component (required).
  3. The NPC will display the title "Ability Crafter" in lavender color in the UI.

Example

// Example 1: Setting up an AbilityCrafter NPC in the Unity Editor
// 1. Add the AbilityCrafter script to an NPC GameObject.
// 2. Ensure SceneObjectNamer is also attached.
// 3. The NPC will now allow players to craft or modify abilities.

// Example 2: Accessing the title and color in code
var crafter = GetComponent<AbilityCrafter>();
Debug.Log(crafter.Title); // Outputs: Ability Crafter
Debug.Log(crafter.TitleColor);

Best Practices

  • Always attach SceneObjectNamer to GameObjects with AbilityCrafter to ensure proper naming in the scene.
  • Use the Title and TitleColor properties to customize UI display for different interactable NPCs.
  • Extend AbilityCrafter for more advanced crafting logic or UI if needed.
⚠️ **GitHub.com Fallback** ⚠️