MW UNITY NAMESPACE







































BuiltInExecFunctions


A list of built-in [BuiltInExec] Functions.



public static void

QuitGame ()

Summary:

Exit the game.

Remarks:

In editor mode, this will call Debug.Break() and print a quit message to the console.



public static void

RestartScene ()

Summary:

Restarts and reloads the current scene.



public static void

LoadSceneBuildIndex (int BuildIndex)

Summary:

Loads a Scene by Build Index.

Remarks:

Assumes that the Scene with Build Index has been added in the Unity Editor.



public static void

SetTimeScale (float InTimeScale)

Summary:

Sets Time.timeScale to InTimeScale.



public static void

SetTargetFPS (int InFPS)

Summary:

Sets the game's target frame rate to InFPS.

Remarks:

The minimum InFPS is 1.



public static void

SendMessage (GameObject G, string Message)

Summary:

Sends Message to G.

Params:

G:

        The GameObject to send Message to.

Message:

        The Message to send to G.



public static void

SetActive (GameObject G, bool bInActive)

Summary:

Sets G's active state to bInActive.



public static void

Destroy (GameObject G)

Summary:

Destroys G.



public static void

DestroyComponent (MonoBehaviour M)

Summary:

Destroys component M from it's GameObject.



public static void

SetComponentActive (MonoBehaviour M, bool bInActive)

Summary:

Sets M's active state to bInActive.



public static void

Teleport (Transform T, Vector3 Position)

Summary:

Teleports T to Position in world space.



public static void

SetVelocity (Rigidbody R, Vector3 Velocity)

Summary:

Sets the Velocity of a Rigidbody.



public static void

SetZeroVelocity (Rigidbody R)

Summary:

Zero-out a Rigidbody's velocity.



public static void

F_SetAnimationParameter (Animator Animator, string Parameter, float F)

Summary:

Sets a float animation parameter



public static void

B_SetAnimationParameter (Animator Animator, string Parameter, bool B)

Summary:

Sets a bool animation parameter.



public static void

I_SetAnimationParameter (Animator Animator, string Parameter, int I)

Summary:

Sets an int animation parameter.



public static void

TriggerAnimation (Animator Animator, string Trigger)

Summary:

Triggers an animation trigger.


public abstract class : MonoBehaviour

MConsole


A Console Debugger for debugging games during runtime.



public abstract Type[]

ExecTypes

The Type to get the Assembly of the Unity Game where ExecAttributes are defined.



public virtual KeyCode

ShowConsoleKey

The KeyCode to show the Console GUI.



protected Dictionary< string, MethodExec< MethodInfo, ExecAttribute >>

Funcs

Exec attributes and their reflected functions.



protected bool

bShowConsole

True to show the MConsole GUI.



protected string

RawInput

The raw string input given by the developer using MConsole's GUI.



protected MArray

PreviousInputs

The previous Exec'd functions called by MConsole.



public virtual void

Awake ()

Summary:

Finds and constructs the Console and its ExecAttributes.



public virtual void

ShowConsole ()

Summary:

Shows the Console on the in-game viewport.



public void

Exec (String[] Targets, string MethodName, Object[] RawParams)

Summary:

Executes MethodName with RawParams on Targets (if any).

Remarks:

If no Targets are specified, MethodName will execute on all GameObjects of its declaring type.

Params:

Targets:

        The names of GameObjects to execute MethodName on. If null or empty, Object.FindObjectOfType will be used instead.

MethodName:

        The name of the method to execute. (This is case-sensitive)

RawParams:

        The parameters to pass to the method.

Returns:

An object containing the return type of the Exec function. Null if errored or Target/s were specified.



protected bool

GetTargetFromString (string Target, GameObject& TargetObject)

Summary:

Gets the GameObject named Target.

Params:

Target:

        The name of the GameObject to find.

TargetObject:

        Out reference to the GameObject named Target.

Returns:

True if a GameObject named Target was found. Otherwise, false.



public virtual bool

HandleCustomParameter (Object[] RawParameters, int& ParamIndex, Object& TargetObject, Type ExecParameterType)

Summary:

Handles custom parameter types for MConsole to parse and execute methods and functions.

Remarks:

Natively supported types are:
MVector and Vector3.
MRotator.
GameObject and Transform, given a GameObject Target by hierarchy-name reference.
Any MonoBehaviour component, given a GameObject Target by hierarchy-name reference.
All primitive types.

Do not call the base method if you are overriding.

Params:

RawParameters:

        The Parameters entered into as RawInput to the MConsole GUI.

ParamIndex:

        The current index of the Parameters array that requires custom parsing.

TargetObject:

        The fully parsed custom type parameter as an object.

ExecParameterType:

        The [Exec] function's required parameter type.

Returns:

True if the Custom Parameter was properly handled and TargetObject is the type and value of the custom ExecParameterType.



public virtual bool

HandleCustomArrayType (Object& TargetObject, Type ElementType, MArray<Object> Elements)

Summary:

Handles custom array types for MConsole to parse arrays and pass them into methods and functions.

Remarks:

Natively supported types are:
MVector and Vector3.
MRotator.
GameObject and Transform, given a GameObject Target by hierarchy-name reference.
Any MonoBehaviour component, given a GameObject Target by hierarchy-name reference.
All primitive types.

Do not call the base method if you are overriding.

Params:

TargetObject:

        The fully parsed single-dimensional array of the custom type parameter.

ElementType:

        The array's element type.

Elements:

        The elements of the array as objects. These need to be cast into ElementType.

Returns:

True if an array of ElementType was successfully parsed into TargetObject and holds the value of all Elements.



protected virtual void

WriteToOutput (string Output, bool bWithTrailingNewLine)

Summary:

Writes to the MConsole Output.

Params:

Output:

        The string to write to the MConsole Output.

bWithTrailingNewLine:

        True to write to the MConsole Output with a new line escape character.



protected virtual void

WriteToOutput (StringBuilder Output, bool bWithTrailingNewLine)

Summary:

Writes to the MConsole Output.

Params:

Output:

        The StringBuilder with the contents to write to the MConsole Output.

bWithTrailingNewLine:

        True to write to the MConsole Output with a new line escape character.



protected void

WriteToOutput (string Output, MVector Colour)

Summary:

Writes to the MConsole Output with a Colour.

Params:

Output:

        The string to write to the MConsole Output.

Colour:

        If #RELEASE, RGB Colour to print to the MConsole Output. If #STANDALONE, the ConsoleColor to print to the Terminal.



protected void

WriteToOutput (StringBuilder Output, MVector Colour)

Summary:

Writes to the MConsole Output with a Colour.

Params:

Output:

        The StringBuilder with the contents to write to the MConsole Output.

Colour:

        If #RELEASE, RGB Colour to print to the MConsole Output. If #STANDALONE, the ConsoleColor to print to the Terminal.



protected void

WriteToOutput (string Output, MVector Colour, bool bWithTrailingNewLine)

Summary:

Writes to the MConsole Output with a Colour.

Params:

Output:

        The StringBuilder with the contents to write to the MConsole Output.

Colour:

        If #RELEASE, RGB Colour to print to the MConsole Output. If #STANDALONE, the ConsoleColor to print to the Terminal.

bWithTrailingNewLine:

        True to write to the MConsole Output with a new line escape character.



protected void

WriteToOutput (StringBuilder Output, MVector Colour, bool bWithTrailingNewLine)

Summary:

Writes to the MConsole Output with a Colour.

Params:

Output:

        The StringBuilder with the contents to write to the MConsole Output.

Colour:

        If #RELEASE, RGB Colour to print to the MConsole Output. If #STANDALONE, the ConsoleColor to print to the Terminal.

bWithTrailingNewLine:

        True to write to the MConsole Output with a new line escape character.



protected virtual string

GetPersistentOutput ()

Summary:

Gets the content on the bottom of the MConsole Output.

Remarks:

This is usually for changing variables that you may want to know or keep track of during runtime.

Returns:

The Persistent Output. By default, this is the FPS, DeltaTime, and the __HELP__ command.



protected virtual void

Update ()

Summary:

Unity Update() Function.

Remarks:

Call the base method if you want the __HELP__ message to be displayed after



public virtual void

OnGUI ()

Summary:

Draws the Console to the in-game viewport.


public class : Attribute

ExecAttribute


The attribute to mark a method executable by Console.Exec().



public string[]

GameObjectTargetsByName

The name of the GameObject to Target this Executable to.



public string

Description

The description of this method.



public bool

bExecOnAwake

True if this method should Exec() on Start.



public bool

bHideInConsole

True if this method should not appear in the Console GUI.



public bool

bRequireTarget

True if this method requires a target to be executed.



public object[]

ExecParams

The parameters to automatically execute when bExecOnAwake is true.


CONSTRUCTOR ()

Summary:

Default Exec.


CONSTRUCTOR (bool bTargetRequired, string Desc)

Summary:

Exec specifying if a Target is Required and a Description.

Params:

bTargetRequired:

        True if a Target is Required to Exec.

Desc:

        The Description.


CONSTRUCTOR (string Desc)

Summary:

Exec with a Description.

Params:

Desc:

        The Description.


CONSTRUCTOR (string Desc, String[] Targets)

Summary:

Exec with a Description and a Target.

Params:

Desc:

        The Description.

Targets:

        The names of the GameObjects to Target call this Exec on.


CONSTRUCTOR (string Desc, bool bOnAwake, Object[] Params)

Summary:

Exec that can be called from during Awake() with custom parameters.

Remarks:

If bOnAwake is false, this acts as a normal Exec(Desc), and Params will be ignored.

Params:

Desc:

        The Description.

bOnAwake:

        If this method should be executed on start.

Params:

        The Parameters to execute with bOnAwake.