File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed
Assets/MapEditor/Managers Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 77
88public static class PathManager
99{
10+ #region Init
11+ [ InitializeOnLoadMethod ]
12+ public static void Init ( )
13+ {
14+ EditorApplication . update += OnProjectLoad ;
15+ }
16+
17+ private static void OnProjectLoad ( )
18+ {
19+ DefaultPath = Resources . Load < GameObject > ( "Paths/Path" ) ;
20+ DefaultNode = Resources . Load < GameObject > ( "Paths/PathNode" ) ;
21+ PathParent = GameObject . FindGameObjectWithTag ( "Paths" ) . transform ;
22+ if ( DefaultPath != null && DefaultNode != null && PathParent != null )
23+ EditorApplication . update -= OnProjectLoad ;
24+ }
25+ #endregion
26+
1027 public static GameObject DefaultPath { get ; private set ; }
1128 public static GameObject DefaultNode { get ; private set ; }
1229 public static Transform PathParent { get ; private set ; }
@@ -21,20 +38,7 @@ public enum PathType
2138 Powerline = 2 ,
2239 }
2340
24- [ InitializeOnLoadMethod ]
25- public static void Init ( )
26- {
27- EditorApplication . update += OnProjectLoad ;
28- }
29-
30- static void OnProjectLoad ( )
31- {
32- DefaultPath = Resources . Load < GameObject > ( "Paths/Path" ) ;
33- DefaultNode = Resources . Load < GameObject > ( "Paths/PathNode" ) ;
34- PathParent = GameObject . FindGameObjectWithTag ( "Paths" ) . transform ;
35- if ( DefaultPath != null && DefaultNode != null && PathParent != null )
36- EditorApplication . update -= OnProjectLoad ;
37- }
41+
3842
3943 public static void SpawnPath ( PathData pathData )
4044 {
Original file line number Diff line number Diff line change 77
88public static class SceneManager
99{
10- public static Scene EditorScene { get ; private set ; }
11-
1210 #region Init
1311 [ InitializeOnLoadMethod ]
1412 private static void Init ( )
@@ -30,6 +28,8 @@ private static void OnProjectLoad()
3028 }
3129 #endregion
3230
31+ public static Scene EditorScene { get ; private set ; }
32+
3333 #region Scene Camera
3434 /// <summary>Sets/Updates the all SceneViews with inputted culling distances.</summary>
3535 /// <param name="prefabDist">Distance to cull prefabs, in meters.</param>
You can’t perform that action at this time.
0 commit comments