1
TNet 3 Support / Re: How to use the WorkerThread script
« on: August 17, 2016, 02:11:51 PM »
Fantastically useful stuff! Thanks for adding it!
It took me a little while to understand what WorkerThread.CreateConditional does. I though it meant that it does something on the thread, then depending on the return value, calls the second delegate - or not. Well, no.
Here is how it really works: The first delegate is called over and over and over until it returns false, then the second delegate is called.
It took me a little while to understand what WorkerThread.CreateConditional does. I though it meant that it does something on the thread, then depending on the return value, calls the second delegate - or not. Well, no.
Here is how it really works: The first delegate is called over and over and over until it returns false, then the second delegate is called.
- TNet.WorkerThread.CreateConditional(
- delegate() {
- return distance > 100f
- }, delegate() {
- Debug.Log( "Close enough!" );
- }
- );