Skip to content

Game.Tutorials.ITutorialUITriggerSystem

Assembly:
Assembly-CSharp (game assembly)

Namespace:
Game.Tutorials

Type:
Interface

Base:
None

Summary:
Interface used to activate and deactivate UI tutorial triggers. Implementations of this interface are responsible for notifying the game's tutorial/UI systems that a named trigger should start or stop its associated tutorial UI behavior. Note: the interface uses the name "DisactivateTrigger" (rather than the more common "DeactivateTrigger") — follow the exact spelling when implementing or calling.


Fields

  • None
    No fields are defined on this interface.

Properties

  • None
    No properties are defined on this interface.

Constructors

  • None
    Interfaces do not define constructors.

Methods

  • void ActivateTrigger(string trigger)
    Call to activate or raise a named UI tutorial trigger. The parameter is typically a short identifier or name that the tutorial/UI system recognizes. Implementations should validate the input (non-null/non-empty) and forward the event to whatever subsystem manages tutorial UI (for example, to show a tip, highlight, or step).

  • void DisactivateTrigger(string trigger)
    Call to deactivate or clear a previously activated UI tutorial trigger. This is used to stop the UI behavior associated with the given trigger. Note the method name uses "Disactivate" — ensure you call the exact method name. As with ActivateTrigger, implementations should validate the input and perform the appropriate teardown/notification.

Usage Example

// Simple example implementation (pseudo-code; integrate with actual game systems)
public class TutorialUITriggerSystem : Game.Tutorials.ITutorialUITriggerSystem
{
    public void ActivateTrigger(string trigger)
    {
        if (string.IsNullOrEmpty(trigger))
            return;

        // Example: forward to the game's tutorial manager or UI coordinator.
        // Replace TutorialManager.Instance... with the actual API available in the game/mod context.
        TutorialManager.Instance?.OnUITriggerActivated(trigger);
    }

    public void DisactivateTrigger(string trigger)
    {
        if (string.IsNullOrEmpty(trigger))
            return;

        TutorialManager.Instance?.OnUITriggerDeactivated(trigger);
    }
}

// Example of calling from mod code:
Game.Tutorials.ITutorialUITriggerSystem triggers = /* obtain implementation from game/mod framework */;
triggers?.ActivateTrigger("ShowElectricityTutorial");
triggers?.DisactivateTrigger("ShowElectricityTutorial");

Notes and tips for modders: - Ensure calls occur on the Unity/main thread unless the implementation is explicitly thread-safe. - Use clear, consistent trigger identifiers (strings) and document any custom triggers your mod introduces. - Avoid spamming ActivateTrigger/DisactivateTrigger rapidly; implement debounce or state checks if needed.