public PopJob(TJobInterface Interface) { // gr: strings aren't converting mInterface = Interface; Command = Marshal.PtrToStringAuto(Interface.sCommand); Error = Marshal.PtrToStringAuto(Interface.sError); }
static void OnJob(ref TJobInterface JobInterface) { // turn into the more clever c# class PopJob Job = new PopJob(JobInterface); UnityEngine.Debug.Log("job! " + Job.Command); if (Job.Error != null) { UnityEngine.Debug.Log("(error: " + Job.Error); } // send job to handler try { TJobHandler Handler = mJobHandlers[Job.Command]; Handler(Job); } catch (KeyNotFoundException) { UnityEngine.Debug.Log("Unhandled job " + Job.Command); } }
public static extern int GetJobParam_Array(ref TJobInterface JobInterface, string Param, string ElementTypeName, System.IntPtr Array, int ArraySize);
public static extern bool GetJobParam_PixelsWidthHeight(ref TJobInterface JobInterface, string Param, ref int Width, ref int Height);
public static extern bool GetJobParam_texture(ref TJobInterface JobInterface, string Param, int Texture, int ConvertToFormat, bool Stretch);
public static extern System.IntPtr GetJobParam_string(ref TJobInterface JobInterface, string Param, string DefaultValue);
public static extern float GetJobParam_float(ref TJobInterface JobInterface, string Param, float DefaultValue);
public static extern int GetJobParam_int(ref TJobInterface JobInterface, string Param, int DefaultValue);