Useful Helpers

Header Builder

The RestRequest class contains methods which allow the caller to specify directly which headers are sent back to the caller. The argument is of type Dictionary<string, List<string>> headers. To ease the creation of this construct, the HeaderBilder class can be used.


    /* httpCode */ 200, 
    /* headers */ new HeaderBuilder(HttpHeader.E_TAG, "").withHeader("2nd.header", ""), 
    /* content */ "OK");

HttpHeader and MimeType

HttpHeader and MimeType define useful constants for Http Headers and Mime Types.


The class ThreadingHelper bridges between the endpoint thread and the unity main rendering thread. See Multithreading for more information.

Profile Marker Since 1.2.0

Profile markers can be assigned when scheduling a workload via ThreadingHelper.Instance.ExecuteXXX methods like this

ThreadingHelper.Instance.ExecuteAsync(() => { 
	transform.position += new Vector3(0.001f, 0.001f, 0.001f); 
}, "Position Updates");

These can now be found inside the profiler

Screenshot of the profiler showing the waterfall graph

By default, the name of the execute method (e.g. ExecuteSync) is used as the profile marker name.