mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 12:03:04 +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
|
||||
|
||||
|
@ -340,7 +340,9 @@ namespace SanAndreasUnity.Editor
|
|||
float diffPerc = endPerc - startPerc;
|
||||
|
||||
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