Skip to content

Commit

Permalink
Merge pull request #2 from UnioGame/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Mefodei authored Mar 17, 2023
2 parents be97ef0 + 437474a commit 8f7f570
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 37 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
path = UniGame.AddressableTools
url = https://github.com/UniGameTeam/UniGame.AddressableTools.git
branch = main
[submodule "UniGame.SceneAssets"]
path = UniGame.SceneAssets
url = https://github.com/UniGameTeam/UniGame.SceneAssets.git
branch = main
[submodule "UniGame.AddressablesImporter/unity-addressable-importer"]
path = UniGame.AddressablesImporter/unity-addressable-importer
url = https://github.com/UniGameTeam/unity-addressable-importer.git
Expand Down
2 changes: 1 addition & 1 deletion UniGame.AddressableTools
2 changes: 1 addition & 1 deletion UniGame.Context
2 changes: 1 addition & 1 deletion UniGame.Core
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,36 @@ public static void OnDidReloadScripts()
static ScenePlaybackDetector()
{
IsPlaying = EditorApplication.isPlaying;
EditorApplication.playModeStateChanged -= OnPlaymodeStateChanged;
EditorApplication.playModeStateChanged += OnPlaymodeStateChanged;
}

private static void OnPlaymodeStateChanged(PlayModeStateChange e)
{
switch (e)
{
case PlayModeStateChange.EnteredEditMode:
case PlayModeStateChange.ExitingEditMode:
case PlayModeStateChange.ExitingPlayMode:
IsPlaying = false;
break;
case PlayModeStateChange.EnteredPlayMode:
IsPlaying = true;
break;
}

EditorApplication.playModeStateChanged += e =>
// Before scene start: isPlayingOrWillChangePlaymode = false; isPlaying = false
// Pressed Playback button: isPlayingOrWillChangePlaymode = true; isPlaying = false
// Playing: isPlayingOrWillChangePlaymode = false; isPlaying = true
// Pressed stop button: isPlayingOrWillChangePlaymode = true; isPlaying = true
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
{
AboutToStartScene = true;
}
else
{
switch (e)
{
case PlayModeStateChange.EnteredEditMode:
case PlayModeStateChange.ExitingEditMode:
case PlayModeStateChange.ExitingPlayMode:
IsPlaying = false;
break;
case PlayModeStateChange.EnteredPlayMode:
IsPlaying = true;
break;
}
// Before scene start: isPlayingOrWillChangePlaymode = false; isPlaying = false
// Pressed Playback button: isPlayingOrWillChangePlaymode = true; isPlaying = false
// Playing: isPlayingOrWillChangePlaymode = false; isPlaying = true
// Pressed stop button: isPlayingOrWillChangePlaymode = true; isPlaying = true
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
{
AboutToStartScene = true;
}
else
{
AboutToStartScene = false;
}
};
AboutToStartScene = false;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion UniGame.Rx
1 change: 0 additions & 1 deletion UniGame.SceneAssets
Submodule UniGame.SceneAssets deleted from b07f17
2 changes: 1 addition & 1 deletion UniGame.TypeConverters
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "UniGame Core Modules Collection",
"description": "",
"unity": "2021.3",
"version": "2022.4.11",
"version": "2023.0.2",
"keywords": [
"editor",
"codogen",
Expand All @@ -18,7 +18,7 @@
"url": "https://github.com/UniGameTeam/CoreModules.git"
},
"dependencies": {
"com.unity.addressables": "1.21.1",
"com.unity.addressables": "1.21.8",
"com.unity.textmeshpro": "3.0.6",
"com.unity.ugui": "1.0.0",
"com.unity.editorcoroutines": "1.0.0",
Expand Down

0 comments on commit 8f7f570

Please sign in to comment.