This repository was archived by the owner on May 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public static class ConfigManager
24
24
public static ConfigElement < string > Default_Output_Path ;
25
25
public static ConfigElement < bool > Log_Unity_Debug ;
26
26
public static ConfigElement < bool > Hide_On_Startup ;
27
+ public static ConfigElement < float > Startup_Delay_Time ;
27
28
28
29
public static ConfigElement < string > Last_Window_Anchors ;
29
30
public static ConfigElement < string > Last_Window_Position ;
@@ -85,6 +86,10 @@ private static void CreateConfigElements()
85
86
"The default output path when exporting things from UnityExplorer." ,
86
87
Path . Combine ( ExplorerCore . Loader . ExplorerFolder , "Output" ) ) ;
87
88
89
+ Startup_Delay_Time = new ConfigElement < float > ( "Startup Delay Time" ,
90
+ "The delay on startup before the UI is created." ,
91
+ 1f ) ;
92
+
88
93
// Internal configs
89
94
90
95
Last_Window_Anchors = new ConfigElement < string > ( "Last_Window_Anchors" ,
Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Collections ;
2
3
using System . IO ;
3
4
using UnityEngine ;
4
5
using UnityExplorer . Core . Config ;
@@ -13,7 +14,7 @@ namespace UnityExplorer
13
14
public class ExplorerCore
14
15
{
15
16
public const string NAME = "UnityExplorer" ;
16
- public const string VERSION = "3.3.11 " ;
17
+ public const string VERSION = "3.3.12 " ;
17
18
public const string AUTHOR = "Sinai" ;
18
19
public const string GUID = "com.sinai.unityexplorer" ;
19
20
@@ -44,10 +45,24 @@ public static void Init(IExplorerLoader loader)
44
45
45
46
InputManager . Init ( ) ;
46
47
47
- UIManager . Init ( ) ;
48
-
49
48
Log ( $ "{ NAME } { VERSION } initialized.") ;
50
49
50
+ RuntimeProvider . Instance . StartCoroutine ( SetupCoroutine ( ) ) ;
51
+ }
52
+
53
+ // Do a delayed setup so that objects aren't destroyed instantly.
54
+ // This can happen for a multitude of reasons.
55
+ // Default delay is 1 second which is usually enough.
56
+ private static IEnumerator SetupCoroutine ( )
57
+ {
58
+ float f = Time . realtimeSinceStartup ;
59
+ float delay = ConfigManager . Startup_Delay_Time . Value ;
60
+ while ( Time . realtimeSinceStartup - f < delay )
61
+ yield return null ;
62
+
63
+ Log ( $ "Creating UI, after delay of { delay } second(s).") ;
64
+ UIManager . Init ( ) ;
65
+
51
66
//InspectorManager.Instance.Inspect(typeof(TestClass));
52
67
}
53
68
You can’t perform that action at this time.
0 commit comments