public void ShouldCallbackOnCommand() { ThreadCommand.OnExecute += new OnExecuteDelegate(ThreadCommand_OnExecute); ThreadQueue<ThreadCommand> threadQueue = new ThreadQueue<ThreadCommand>(); TestObject test = new TestObject(); test.TestString = "Hello World"; threadQueue.Enqueue(test); _resetEvent.WaitOne(); threadQueue.Dispose(); }
/// <summary> /// Called when script is destroyed /// </summary> private void OnDestroy() { // dispose thread queue _threadQueue.Dispose(); Debug.LogFormat("{0} - \"{1}\" destroyed", name, _userId); }