DungeonEntrance - jimdroberts/FishMMO GitHub Wiki
Interactable representing a dungeon entrance. Displays a title and optional image in the UI.
-
private string title
The display title for the dungeon entrance, shown in the UI.
-
public string DungeonName
The name of the dungeon associated with this entrance.
-
public Image DungeonImage
The image representing the dungeon entrance in the UI (client only).
-
public override string Title { get; }
Gets the display title for the dungeon entrance.
- Attach the DungeonEntrance component to an interactable GameObject in your scene.
- Set the DungeonName and (optionally) assign a DungeonImage in the Inspector.
- The entrance will display the title and image in the UI when interacted with.
// Example 1: Setting up a DungeonEntrance in the Unity Editor
// 1. Add the DungeonEntrance script to an interactable GameObject.
// 2. Set the DungeonName and assign a DungeonImage if desired.
// 3. The GameObject will now act as a dungeon entrance in the UI.
// Example 2: Accessing the title in code
var entrance = GetComponent<DungeonEntrance>();
Debug.Log(entrance.Title); // Outputs: Dungeon
Debug.Log(entrance.DungeonName);
- Use DungeonEntrance for objects that represent entrances to dungeons or special areas.
- Assign a unique DungeonName for each entrance to distinguish them in the UI and logic.
- Optionally assign a DungeonImage to enhance the UI experience for players.
- Extend DungeonEntrance for custom logic or effects if needed.