class MAGES::Hub

Overview

The primary Component of MAGES NXT. Manages all core MAGES interfaces. More…

class Hub: public MonoBehaviour
{
public:
    // fields

    static const string StubBundlePath = "Packages/com.oramavr.mages.nxt.core/Hub/Runtime/Bundles/StubBundle.asset";

    // properties

    Hub Instance;
    string Version;
    Rig Rig;
    Bundle BaseBundle;
    Bundle RuntimeBundle;
    bool AutoStart;

    // methods

    static Bundle CreateStubBundle();
    static Bundle FindCurrentBundle();
    static LicenseLimits GetLicenseLimits();
    static void Log(string category, string message, int verbosity = 0);
    static void Wrn(string category, string message, int verbosity = 0);
    static void Err(string category, string message, int verbosity = 0);

    static void DebugDrawSolidBox(
        Vector3 pos,
        Color color,
        Quaternion? rot = null,
        Vector3? scale = null,
        float time = 0.0f,
        string label = null,
        int verbosity = 7
    );

    static void DebugDrawWireBox(
        Vector3 pos,
        Color color,
        Quaternion? rot = null,
        Vector3? scale = null,
        float time = 0.0f,
        string label = null,
        int verbosity = 7
    );

    static void DebugDrawArrow(
        Vector3 pos,
        Vector3 direction,
        Color color,
        float length = 0.2f,
        float time = 0.0f,
        string label = null,
        int verbosity = 7
    );

    static void DebugDrawArrowLine(
        Vector3 begin,
        Vector3 end,
        Color color,
        float time = 0.0f,
        string label = null,
        int verbosity = 7
    );

    static void DebugDrawLine(
        Vector3 begin,
        Vector3 end,
        Color color,
        float time = 0.0f,
        string label = null,
        int verbosity = 7
    );

    static T GetModule< T >();
    static T GetSubModule< T >();
    T Get< T >();
    void StartSystems();
    void StopSystems();
};

Detailed Documentation

The primary Component of MAGES NXT. Manages all core MAGES interfaces.

Fields

static const string StubBundlePath = "Packages/com.oramavr.mages.nxt.core/Hub/Runtime/Bundles/StubBundle.asset"

The path to the stub bundle asset.

Properties

Hub Instance

Gets the instanced Hub (Runtime Only).

string Version

Gets the version of the MAGES package.

Rig Rig

Gets the instantiated Rig.

Bundle BaseBundle

Gets or sets the base bundle from which the runtime bundle is constructed.

Bundle RuntimeBundle

Gets the runtime bundle.

bool AutoStart

Gets or sets a value indicating whether the Hub should automatically start (useful when spawned manually).

Methods

static Bundle CreateStubBundle()

Create a stub bundle.

Returns:

Bundle.

static Bundle FindCurrentBundle()

Find the current bundle. Can be called both in edit-mode and play-mode.

Returns:

The current bundle, if available.

static LicenseLimits GetLicenseLimits()

Gets the license limits.

Use wisely (slow), performs file access.

Returns:

The license limits.

static void Log(string category, string message, int verbosity = 0)

Log a message.

Parameters:

category

The message category.

message

The message.

verbosity

The verbosity level.

static void Wrn(string category, string message, int verbosity = 0)

Log a warning.

Parameters:

category

The category.

message

The message to log.

verbosity

The verbosity level.

static void Err(string category, string message, int verbosity = 0)

Log an error.

Parameters:

category

The category.

message

The message to log.

verbosity

The verbosity level.

static void DebugDrawSolidBox(
    Vector3 pos,
    Color color,
    Quaternion? rot = null,
    Vector3? scale = null,
    float time = 0.0f,
    string label = null,
    int verbosity = 7
)

Draws a solid box.

Parameters:

pos

The position of the box.

color

The color of the box.

rot

The rotation of the box.

scale

The scale of the box.

time

Time to persist.

label

Label of the box.

verbosity

The verbosity level.

static void DebugDrawWireBox(
    Vector3 pos,
    Color color,
    Quaternion? rot = null,
    Vector3? scale = null,
    float time = 0.0f,
    string label = null,
    int verbosity = 7
)

Draws a wireframe box.

Parameters:

pos

The position of the box.

color

The color of the box.

rot

The rotation of the box.

scale

The scale of the box.

time

Time to persist.

label

Label of the box.

verbosity

The verbosity level.

static void DebugDrawArrow(
    Vector3 pos,
    Vector3 direction,
    Color color,
    float length = 0.2f,
    float time = 0.0f,
    string label = null,
    int verbosity = 7
)

Draws an arrow.

Parameters:

pos

The origin of the arrow.

direction

The direction of the arrow.

color

The color of the arrow.

length

The extent of the arrow.

time

Time to persist.

label

The label of the arrow.

verbosity

The verbosity level.

static void DebugDrawArrowLine(
    Vector3 begin,
    Vector3 end,
    Color color,
    float time = 0.0f,
    string label = null,
    int verbosity = 7
)

Draws an arrow line.

Parameters:

begin

The start of the arrow.

end

The end of the arrow.

color

The color of the arrow.

time

Time to persist.

label

The label of the arrow.

verbosity

The verbosity level.

static void DebugDrawLine(
    Vector3 begin,
    Vector3 end,
    Color color,
    float time = 0.0f,
    string label = null,
    int verbosity = 7
)

Draws a line.

Parameters:

begin

The start of the line.

end

The end of the line.

color

The color of the line.

time

Time to persist.

label

The label of the line.

verbosity

The verbosity level.

static T GetModule< T >()

Get a module.

Parameters:

T

The module type.

Returns:

The module.

T Get< T >()

Get a module.

Parameters:

T

The module type to get.

ArgumentException

Raised when an invalid type is provided.

Returns:

The module instance.

void StartSystems()

Start all systems.

void StopSystems()

Stops all systems.