class MAGES::Analytics::AnalyticsUtilities

Overview

Class containing utility functions for the Analytics module. More…

class AnalyticsUtilities
{
public:
    // enums

    enum Hook;

    // methods

    static List GetActiveActions();
    static GameObject Spawn(GameObject prefab);
    static void Destroy(GameObject prefab);
    static void AttachCallback(this GameObject g, Hook hook, UnityAction callback);

    static void AttachCallback(
        this GameObject g,
        Hook hook,
        UnityAction> callback
    );

    static void DetachCallback(
        this GameObject g,
        Hook hook,
        UnityAction> callback
    );

    static GameObject SpawnInteractor(GameObject prefab);
    static void DestroyInteractor(GameObject prefab);
};

Detailed Documentation

Class containing utility functions for the Analytics module.

Methods

static List GetActiveActions()

Finds all the currently active actions and returns their names.

Returns:

A list containing the names of all the currently active actions.

static GameObject Spawn(GameObject prefab)

Spawns the given prefab and attaches the AnalyticsManagedObject component to the prefab.

Parameters:

prefab

The prefab to spawn.

Returns:

The instantiated prefab.

static void Destroy(GameObject prefab)

Destroys the given prefab.

This method requires the AnalyticsManagedObject component to be attached to the GameObject.

Parameters:

prefab

The prefab to destroy.

static void AttachCallback(this GameObject g, Hook hook, UnityAction callback)

Attaches the given callback to the given hook for the given gameobject.

This method requires the AnalyticsManagedObject component to be attached to the GameObject in order to work properly.

Parameters:

g

The gameobject that is associated with the hook.

hook

The type of hook.

callback

The callback to attach to the hook.

static void AttachCallback(
    this GameObject g,
    Hook hook,
    UnityAction> callback
)

Attaches the given callback to the given hook for the given gameobject.

This method requires the AnalyticsManagedObject component to be attached to the GameObject in order to work properly.

Parameters:

g

The gameobject that is associated with the hook.

hook

The type of hook.

callback

The callback to attach to the hook.

static void DetachCallback(
    this GameObject g,
    Hook hook,
    UnityAction> callback
)

Detaches the given callback from the given hook for the given game object.

This method requires the AnalyticsManagedObject component to be attached to the GameObject in order to work properly.

Parameters:

g

The gameobject that is associated with the hook.

hook

The type of hook.

callback

The callback to detach from the hook.

static GameObject SpawnInteractor(GameObject prefab)

Handles the spawning of interactors.

Parameters:

prefab

The interactor prefab.

Returns:

The spawned interactor.

static void DestroyInteractor(GameObject prefab)

Handles the destruction of interactors.

Parameters:

prefab

The interactor to be destroyed.