Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
avvy
mobile-app
Commits
aa02771d
Commit
aa02771d
authored
2 years ago
by
Sally552sally
Browse files
Options
Download
Email Patches
Plain Diff
корректный перезапуск сцены
parent
25a76bf0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Assets/AvvyLand/Scripts/ECS/Components/Main/SceneLoadedSingletonTag.cs
+2
-1
...nd/Scripts/ECS/Components/Main/SceneLoadedSingletonTag.cs
Assets/AvvyLand/Scripts/ECS/Systems/InitSystemGroup/ReloadSceneSystem.cs
+10
-0
.../Scripts/ECS/Systems/InitSystemGroup/ReloadSceneSystem.cs
Assets/AvvyLand/Tests/ECS/Systems/InitSystemGroup/TestResetAllSystem.cs
+0
-21
...d/Tests/ECS/Systems/InitSystemGroup/TestResetAllSystem.cs
with
12 additions
and
22 deletions
+12
-22
Assets/AvvyLand/Scripts/ECS/Components/Main/SceneLoadedSingletonTag.cs
View file @
aa02771d
...
...
@@ -3,6 +3,7 @@ using Unity.Entities;
namespace
AvvyLand.Scripts.ECS.Components.Main
{
public
struct
SceneLoadedSingletonTag
:
IComponentData
{
{
public
bool
isLoad
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Assets/AvvyLand/Scripts/ECS/Systems/InitSystemGroup/ReloadSceneSystem.cs
View file @
aa02771d
...
...
@@ -21,6 +21,16 @@ namespace AvvyLand.Scripts.ECS.Systems.InitSystemGroup
protected
override
void
OnUpdate
()
{
if
(!
HasSingleton
<
SceneLoadedSingletonTag
>())
return
;
var
loading
=
GetSingleton
<
SceneLoadedSingletonTag
>();
if
(
loading
.
isLoad
)
return
;
var
entity
=
GetSingletonEntity
<
SceneLoadedSingletonTag
>();
loading
.
isLoad
=
true
;
EntityManager
.
SetComponentData
(
entity
,
loading
);
SceneManager
.
LoadSceneAsync
(
SceneManager
.
GetActiveScene
().
name
).
completed
+=
operation
=>
{
if
(
HasSingleton
<
SceneLoadedSingletonTag
>())
...
...
This diff is collapsed.
Click to expand it.
Assets/AvvyLand/Tests/ECS/Systems/InitSystemGroup/TestResetAllSystem.cs
View file @
aa02771d
...
...
@@ -193,27 +193,6 @@ namespace AvvyLand.Tests.ECS.Systems.InitSystemGroup
Assert
.
True
(
_testSystem
.
HasSingleton
<
SceneLoadedSingletonTag
>());
}
//[UnityTest, Order(7)]
//public IEnumerator TestSceneLoad()
//{
// var reset = m_Manager.CreateEntity();
// m_Manager.AddComponent<ResetAllComponent>(reset);
// _configSystem.Update();
// var timer = 0f;
// while (MainAppConfig.Instance == null && timer < 10)
// {
// yield return new WaitForSeconds(0.5f);
// timer += 0.5f;
// }
// Assert.True(MainAppConfig.Instance != null);
// _testSystem.Update();
// yield return new WaitForSeconds(3f);
// Assert.False(_testSystem.HasSingleton<SceneLoadedSingletonTag>());
//}
[
Test
,
Order
(
8
)]
public
void
TestIgnoreReset
()
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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
Menu
Projects
Groups
Snippets
Help