Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ease-ph
DeepLanguageUnderstanding
Physics Simulator
Commits
17378372
Verified
Commit
17378372
authored
Mar 10, 2020
by
Sebastian Höffner
Browse files
Loading scenes only if necessary.
parent
6e920ec3
Changes
1
Show whitespace changes
Inline
Side-by-side
Assets/DLU/Scripts/SceneController.cs
View file @
17378372
...
@@ -18,12 +18,12 @@ public class SceneController : MonoBehaviour
...
@@ -18,12 +18,12 @@ public class SceneController : MonoBehaviour
public
void
Start
()
public
void
Start
()
{
{
if
(
SceneManager
.
sceneCount
==
1
)
if
(
!
SceneManager
.
GetSceneByName
(
contextScene
).
isLoaded
)
{
{
SceneManager
.
sceneLoaded
+=
SimpleSceneLoaded
;
SceneManager
.
sceneLoaded
+=
SimpleSceneLoaded
;
SceneManager
.
LoadSceneAsync
(
contextScene
,
LoadSceneMode
.
Additive
);
SceneManager
.
LoadSceneAsync
(
contextScene
,
LoadSceneMode
.
Additive
);
}
}
if
(!
Application
.
isEditor
)
if
(!
Application
.
isEditor
&&
!
SceneManager
.
GetSceneByName
(
"UI"
).
isLoaded
)
{
{
SceneManager
.
LoadSceneAsync
(
"UI"
,
LoadSceneMode
.
Additive
);
SceneManager
.
LoadSceneAsync
(
"UI"
,
LoadSceneMode
.
Additive
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment