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 void AssignJobHandler(string JobName, TJobHandler Delegate) { mJobHandlers[JobName] = Delegate; }