Skip to content

Commit d077a77

Browse files
committed
Revert change to auto-load the first sample scene.
Because it causes problems in some cases.
1 parent cc9a080 commit d077a77

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

Assets/CesiumForUnitySamples/CesiumSamplesScene.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818
[InitializeOnLoad]
1919
static class CesiumSamplesSceneManager
2020
{
21-
static readonly string samplesKey = "OpenedCesiumSamples";
22-
2321
static CesiumSamplesSceneManager()
2422
{
2523
DisableTextMeshProIcons();
2624

2725
EditorSceneManager.sceneOpened += ResetSceneViewCamera;
28-
EditorApplication.update += OpenFirstSampleScene;
29-
EditorApplication.quitting += RemoveSamplesKeyFromPlayerPrefs;
3026
}
3127

3228
// There's no public API to disable component icons in the SceneView, which
@@ -65,26 +61,6 @@ static void DisableTextMeshProIcons()
6561
}
6662
}
6763

68-
// Unity will not open the first sample scene on its own, so this manually opens
69-
// the sample scene when the Editor is first opened. The PlayerPref prevents
70-
// the first scene from being re-opened whenever the user's code compiles.
71-
static void OpenFirstSampleScene()
72-
{
73-
EditorApplication.update -= OpenFirstSampleScene;
74-
if(PlayerPrefs.GetInt(samplesKey, -1) > 0)
75-
{
76-
return;
77-
}
78-
79-
PlayerPrefs.SetInt(samplesKey, 1);
80-
EditorSceneManager.OpenScene("Assets/Scenes/01_CesiumWorld.unity");
81-
}
82-
83-
static void RemoveSamplesKeyFromPlayerPrefs()
84-
{
85-
PlayerPrefs.DeleteKey(samplesKey);
86-
}
87-
8864
static void ResetSceneViewCamera(Scene scene, OpenSceneMode mode)
8965
{
9066
GameObject[] gameObjects = scene.GetRootGameObjects();

0 commit comments

Comments
 (0)