Commit b0404645 authored by Bronuh's avatar Bronuh
Browse files

Fix attempt to clear disposed UI

- upgrade version
parent 8b8167d2
Showing with 14 additions and 12 deletions
+14 -12
......@@ -4,14 +4,14 @@
<EnableDynamicLoading>true</EnableDynamicLoading>
<RootNamespace/>
<PackageId>VectorSurvivors</PackageId>
<Version>0.2.0.1</Version>
<Version>0.2.1.0</Version>
<Title>VectorSurvivors</Title>
<Authors>Bronuh</Authors>
<Description>Vampire-like игра про геометрические фигуры</Description>
<AssemblyName>VectorSurvivors</AssemblyName>
<Product>VectorSurvivors</Product>
<AssemblyVersion>0.2.0.1</AssemblyVersion>
<FileVersion>0.2.0.1</FileVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<FileVersion>0.2.1.0</FileVersion>
<NoWarn>1701;1702;CS1591</NoWarn>
</PropertyGroup>
......
......@@ -35,8 +35,8 @@ application/modify_resources=true
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version="0.2.0.1"
application/product_version="0.2.0.1"
application/file_version="0.2.1.0"
application/product_version="0.2.1.0"
application/company_name="Bronuh"
application/product_name="Vector Survivors"
application/file_description=""
......
......@@ -46,7 +46,7 @@ public partial class UiContainer : Node
{
foreach (IUiScene uiScene in StateStack)
{
if (uiScene is Node node)
if (uiScene is Node node && node.IsValid())
{
node.QueueFree();
}
......
......@@ -26,6 +26,7 @@ public partial class World : Node2D
public override void _Ready()
{
NotNullChecker.CheckProperties(this);
Instance = this;
PlayMusic();
_tokens.Add(EventBus.Subscribe<LocalPlayerSpawnedEvent>(OnLocalPlayerSpawned));
_tokens.Add(EventBus.Subscribe<CameraDroppedEvent>(OnCameraDropped));
......
......@@ -24,11 +24,7 @@ public partial class World
public static double Difficulty => (Instance.BaseDifficulty + GameTime / 60 * Instance.DifficultyPerMinute) * Instance.DifficultyFactor;
public static int MaxEnemies => Mathf.CeilToInt(Instance.BaseEnemyCount + Instance.EnemyPerDifficulty * Difficulty);
public World()
{
if(!Instance.IsValid())
Instance = this;
}
public static void AddEntity(Node2D node)
{
......
......@@ -37,7 +37,12 @@ public partial class MainMenu : AbstractStorage, IUiScene
if (tween.IsValid()) tween.Kill();
};
Audio2D.PlayMusic(Music.MainBgm);
PlayMusic();
}
private void PlayMusic()
{
Audio2D.PlayMusic(Music.MainBgm, 0.5f).Finished += PlayMusic;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment