Skip to content

Commit

Permalink
#604 make a few sections use fewer lines
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldgenerator7 committed Aug 12, 2024
1 parent 04dfee9 commit 560ad8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
10 changes: 2 additions & 8 deletions Assets/Scripts/Menu/MenuButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ public virtual bool acceptsDragGesture()

public virtual void activate()
{
if (frame != null)
{
frame.frameCamera();
}
if (mab != null)
{
mab.activate();
}
frame?.frameCamera();
mab?.activate();
}
}
11 changes: 3 additions & 8 deletions Assets/Scripts/Menu/MenuFrame.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

/// <summary>
Expand Down Expand Up @@ -64,14 +65,8 @@ public bool tapInArea(Vector3 tapPos)

public void delegateTap(Vector3 tapPos)
{
foreach (MenuButton mb in buttons)
{
if (mb.tapInArea(tapPos))
{
mb.processTap(tapPos);
return;
}
}
buttons.FirstOrDefault(mb => mb.tapInArea(tapPos))?
.processTap(tapPos);
}
public bool delegateDrag(Vector3 origMPWorld, Vector3 newMPWorld)
{
Expand Down

0 comments on commit 560ad8f

Please sign in to comment.