private static void GenerateThreadedCrossfade() { // generates crossfade frames in queued multi-threaded order // lightens the load on the update function of the animator while (!s_shutDownThreads) { try { MeshAnimator ma = null; while ((ma = DequeueAnimatorForCrossfade()) != null) { if (ma.currentCrossFade.isFading) { ma.GenerateCrossfadeFrame(); System.Threading.Thread.Sleep(0); } } } catch { } int count = 0; do { lock (s_crossfadeAnimators) { count = s_crossfadeAnimators.Count; } if (count == 0) { System.Threading.Thread.Sleep(1); } }while (count == 0); } }
private static void GenerateThreadedCrossfade() { // generates crossfade frames in queued multi-threaded order // lightens the load on the update function of the animator while (!shutDownThreads) { try { MeshAnimator ma = null; while ((ma = DequeueAnimatorForCrossfade()) != null) { if (ma.currentCrossFade.isFading) { ma.GenerateCrossfadeFrame(); } } } catch { } crossfadeWaitHandle.WaitOne(); } }