Skip to content

Commit 67f1954

Browse files
authored
Delete screen panel and ranger beam in OnDestroy (#25)
1 parent 558b201 commit 67f1954

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ Properties/*
1111
code/obj/*
1212
code/Properties/*
1313

14+
wirelib/.vs/*
15+
wirelib/.vscode/*
16+
wirelib/*.csproj
17+
wirelib/obj/*
18+
wirelib/Properties/*
19+
wirelib/code/obj/*
20+
wirelib/code/Properties/*
21+
1422
# Auto-generated asset related files
1523
*.generated.*
1624
*.*_c

code/entities/WireDigitalScreenEntity.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public override void ClientSpawn()
3434
worldPanel.Label.Style.FontColor = Color.White;
3535
}
3636

37+
protected override void OnDestroy()
38+
{
39+
base.OnDestroy();
40+
41+
worldPanel?.Delete();
42+
}
43+
3744
[GameEvent.Client.Frame]
3845
protected void UpdatePanel()
3946
{

code/entities/WireRangerEntity.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,11 @@ public void OnFrame()
144144
}
145145
Beam.SetPosition( 1, tr.EndPosition );
146146
}
147+
148+
protected override void OnDestroy()
149+
{
150+
base.OnDestroy();
151+
152+
Beam?.Destroy(true);
153+
}
147154
}

wirelib/.sbproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"PackageReferences": [],
1515
"EditorReferences": null,
1616
"Metadata": {
17-
"ProjectTemplate": null
17+
"ProjectTemplate": null,
18+
"CsProjName": ""
1819
}
1920
}

0 commit comments

Comments
 (0)