03-20-2020 08:51 AM
var thread = new Thread(delegate () {
// Wait for update process to finish before starting upload process
while (activeProcess)
{
Thread.Sleep(100);
}
retryCount = 0;
Command(targetPlatform, dataPath);
});
thread.Start();
Cool! I'm glad y'all found a really great solution for making things work dynamically. The irony, is that this code is unchanged. It's always done this sort of thread passing thing. The issue, is that now, by virtue of moving things to EditorPrefs, the actual deploy fails constantly because you can't access the EditorPrefs when you're not on the Unity Main Thread, and it throws and error and it's not able to do the actual deploy. Here's for example, the call to get the AppID now: public static string AppID
{
get
{
if (Instance.targetPlatform < OVRPlatformTool.TargetPlatform.None &&
EditorPrefs.HasKey("OVRPlatformToolSettings_AppID" + (int)Instance.targetPlatform))
{
return EditorPrefs.GetString("OVRPlatformToolSettings_AppID" + (int)Instance.targetPlatform);
}
...
An exception will be thrown on the first HasKey that is invoked, because EditorPrefs must be on main thread.03-20-2020 09:03 AM
04-07-2020 01:23 AM