Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings #473

Merged
merged 4 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions VisualPinball.Unity/VisualPinball.Unity/Game/LampPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ private void AssignLampMapping(string id, LampMapping lampMapping)
private readonly struct LampAction
{
public readonly LampState State;
public readonly IApiLamp Lamp;
public readonly LampMapping Mapping;
public readonly IApiLamp? Lamp;
public readonly LampMapping? Mapping;

public LampAction(LampState state)
{
Expand All @@ -289,7 +289,7 @@ public LampAction(LampState state, IApiLamp lamp, LampMapping mapping)

#if UNITY_EDITOR

private UnityEditor.EditorWindow[] _lampManagerWindows;
private UnityEditor.EditorWindow[]? _lampManagerWindows;
private bool _lampManagerWindowsInitialized;

private void RefreshUI()
Expand All @@ -303,7 +303,7 @@ private void RefreshUI()
_lampManagerWindowsInitialized = true;
}

foreach (var manager in _lampManagerWindows) {
foreach (var manager in _lampManagerWindows!) {
manager.Repaint();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ protected static void WalkChildren(IEnumerable node, Action<Transform> action)
protected void UpdateSurfaceReferences(Transform obj)
{
var surfaceComponent = obj.gameObject.GetComponent<IOnSurfaceComponent>();
if (surfaceComponent != null && surfaceComponent.Surface == this) {
if (surfaceComponent != null && ReferenceEquals(surfaceComponent.Surface, this))
{
surfaceComponent.OnSurfaceUpdated();
}
}
Expand Down