Skip to content

Game.Tutorials.ITutorialUIDeactivationSystem

Assembly: Assembly-CSharp (game runtime assembly; if you build a mod this interface is usually in the game's main assembly)
Namespace: Game.Tutorials

Type: interface

Base: — (no base interfaces)

Summary:
Interface used by the tutorial/UI framework to request deactivation of tutorial UI elements by a string tag. Implementations are expected to map the provided tag to one or more UI elements and deactivate/hide them.


Fields

  • This interface declares no fields.
    {{ The interface only defines a contract (method); state and storage belong to concrete implementations. }}

Properties

  • This interface declares no properties.
    {{ If you need state (for example caching tag-to-element mappings), add properties in the implementing class rather than here. }}

Constructors

  • Interfaces do not declare constructors.
    {{ Implementing classes will provide their own constructors as needed. }}

Methods

  • void DeactivateTag(string tag)
    {{ Requests that UI elements associated with the given tag be deactivated/hidden. Implementations should:
  • Treat a null or empty tag defensively (e.g. ignore or log).
  • Decide whether tag matching is case-sensitive.
  • Locate all UI elements registered for that tag and deactivate them.
  • Make Unity API calls (SetActive, enabling/disabling components, etc.) on the main thread. }}

Parameters: - tag — The identifier used to find which tutorial/UI element(s) should be deactivated. Meaning of the tag depends on the implementation (e.g., simple string key, UI object name, category).

Behavior notes: - This method is a command — it does not return success/failure. If you need feedback, extend the interface or add events/callbacks in the implementation. - Keep calls lightweight; if deactivation requires expensive work, consider scheduling it on the main thread or deferring heavy operations. - Ensure thread-safety: do not call UnityEngine API from background threads.

Usage Example

// Example implementation (pseudocode)
public class TutorialUIDeactivationSystem : ITutorialUIDeactivationSystem
{
    // Example registry mapping tags to UI elements (implementation detail)
    private readonly IDictionary<string, List<GameObject>> _registry;

    public void DeactivateTag(string tag)
    {
        if (string.IsNullOrEmpty(tag))
            return;

        if (!_registry.TryGetValue(tag, out var elements))
            return;

        // Must run on Unity main thread when modifying GameObjects
        foreach (var go in elements)
        {
            if (go != null)
                go.SetActive(false);
        }
    }
}

// Example usage
ITutorialUIDeactivationSystem tutorialSystem = /* get implementation via DI/service locator */;
tutorialSystem.DeactivateTag("HideMoveTutorial");

{{ YOUR_INFO }}