Skip to content

Commit 61b19d1

Browse files
Ensure NoteContainer preview object exists before adding things to it
1 parent 8716373 commit 61b19d1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

NoteTweaks/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PropertyGroup>
66
<AssemblyName>NoteTweaks</AssemblyName>
77
<Authors>TheBlackParrot</Authors>
8-
<Version>0.5.0</Version>
8+
<Version>0.5.1</Version>
99
<GameVersion>1.39.1</GameVersion>
1010
<Description>Change various aspects of the default note</Description>
1111
<ProjectHome>https://github.com/TheBlackParrot/NoteTweaks</ProjectHome>

NoteTweaks/UI/PreviewViewController.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ internal class NotePreviewViewController : BSMLAutomaticViewController
3434
private static readonly List<string> FaceNames = new List<string> { "NoteArrow", "NoteCircleGlow", "Circle" };
3535
private static readonly List<string> GlowNames = new List<string> { "NoteArrowGlow", "AddedNoteCircleGlow" };
3636

37+
public NotePreviewViewController()
38+
{
39+
DontDestroyOnLoad(NoteContainer);
40+
}
41+
3742
public static void UpdateDotMesh()
3843
{
3944
if (_dotGlowMesh == null)
@@ -635,6 +640,11 @@ private static async Task Animate(Action<float> transition, CancellationToken ca
635640

636641
protected void OnEnable()
637642
{
643+
if (NoteContainer == null)
644+
{
645+
NoteContainer = new GameObject("_NoteTweaks_NoteContainer");
646+
DontDestroyOnLoad(NoteContainer);
647+
}
638648
Managers.Textures.LoadTextureChoices();
639649

640650
if (HasInitialized)

NoteTweaks/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": "NoteTweaks",
44
"name": "NoteTweaks",
55
"author": "TheBlackParrot",
6-
"version": "0.5.0",
6+
"version": "0.5.1",
77
"description": "Change various aspects of the default note",
88
"gameVersion": "1.39.1",
99
"dependsOn": {

0 commit comments

Comments
 (0)