mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
performance optimizations
This commit is contained in:
parent
5cea14c46e
commit
b2e6ed7467
1 changed files with 5 additions and 3 deletions
|
@ -258,7 +258,7 @@ namespace SanAndreasUnity.Editor
|
|||
|
||||
currentObject.GetComponentOrThrow<MapObject>().Show(1f);
|
||||
|
||||
if (i % 50 == 0)
|
||||
if (i % 100 == 0)
|
||||
{
|
||||
// wait for completion of jobs
|
||||
|
||||
|
@ -341,6 +341,8 @@ namespace SanAndreasUnity.Editor
|
|||
|
||||
long initialNumPendingJobs = LoadingThread.Singleton.GetNumJobsPending();
|
||||
|
||||
yield return null; // this must be done, otherwise LoadingThread does not start processing any job
|
||||
|
||||
long numPendingJobs;
|
||||
do
|
||||
{
|
||||
|
@ -356,7 +358,7 @@ namespace SanAndreasUnity.Editor
|
|||
yield break;
|
||||
}
|
||||
|
||||
yield return null;
|
||||
System.Threading.Thread.Sleep(10); // don't interact with background thread too often, and also reduce CPU usage
|
||||
|
||||
} while (numPendingJobs > 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue