@@ -160,10 +160,6 @@ private void OnEnable()
160
160
this . _images = new List < Texture2D > ( ) ;
161
161
162
162
Cesium3DTileset . OnSetShowCreditsOnScreen += this . ForceUpdateCredits ;
163
- #if UNITY_EDITOR
164
- EditorApplication . playModeStateChanged += HandleEnteringPlayMode ;
165
- EditorSceneManager . sceneClosing += HandleClosingSceneView ;
166
- #endif
167
163
}
168
164
169
165
private void Update ( )
@@ -187,10 +183,6 @@ private void OnDestroy()
187
183
188
184
if ( this == _defaultCreditSystem )
189
185
{
190
- #if UNITY_EDITOR
191
- EditorApplication . playModeStateChanged -= HandleEnteringPlayMode ;
192
- EditorSceneManager . sceneClosing -= HandleClosingSceneView ;
193
- #endif
194
186
_defaultCreditSystem = null ;
195
187
}
196
188
}
@@ -252,7 +244,7 @@ private static CesiumCreditSystem CreateDefaultCreditSystem()
252
244
/// Gets the default credit system, or creates a new default credit system instance if none exist.
253
245
/// </summary>
254
246
/// <returns>The default CesiumCreditSystem instance.</returns>
255
- internal static CesiumCreditSystem GetDefaultCreditSystem ( )
247
+ public static CesiumCreditSystem GetDefaultCreditSystem ( )
256
248
{
257
249
if ( _defaultCreditSystem == null )
258
250
{
@@ -327,35 +319,5 @@ internal IEnumerator LoadImage(string url)
327
319
328
320
texture . wrapMode = TextureWrapMode . Clamp ;
329
321
}
330
-
331
- #if UNITY_EDITOR
332
- /// <summary>
333
- /// This handles the destruction of the credit system between scene switches in the Unity Editor.
334
- /// Without this, the credit system will live between instances and won't properly render the
335
- /// current scene's credits.
336
- /// </summary>
337
- /// <param name="scene">The scene.</param>
338
- /// <param name="removingScene">Whether or not the closing scene is also being removed.</param>
339
- private static void HandleClosingSceneView ( Scene scene , bool removingScene )
340
- {
341
- if ( _defaultCreditSystem != null && _defaultCreditSystem . gameObject . scene == scene )
342
- {
343
- UnityLifetime . Destroy ( _defaultCreditSystem . gameObject ) ;
344
- }
345
- }
346
-
347
- /// <summary>
348
- /// This handles the destruction of the credit system while entering Play Mode.
349
- /// Without this, the persisting credit system's UI will not register with the Play Mode view, leading
350
- /// to missing credits.
351
- /// </summary>
352
- /// <param name="state">The state change between the Edit and Play modes.</param>
353
- private static void HandleEnteringPlayMode ( PlayModeStateChange state )
354
- {
355
- if ( state == PlayModeStateChange . EnteredPlayMode && _defaultCreditSystem != null ) {
356
- UnityLifetime . Destroy ( _defaultCreditSystem . gameObject ) ;
357
- }
358
- }
359
- #endif
360
322
}
361
323
}
0 commit comments