Skip to content

Commit

Permalink
Merge pull request #80 from nowsprinting/chore/rename_emergency_exit_…
Browse files Browse the repository at this point in the history
…annotation

Rename EmergencyExit to EmergencyExitAnnotation
  • Loading branch information
asurato authored Oct 21, 2024
2 parents fcc096f + c8f2e5d commit 0550148
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace DeNA.Anjin.Annotations
/// As soon as the component appears on the screen, it is click by <c>EmergencyExitAgent</c>
/// </summary>
[RequireComponent(typeof(Button))]
public class EmergencyExit : MonoBehaviour
public class EmergencyExitAnnotation : MonoBehaviour
{
}
}
File renamed without changes.
8 changes: 4 additions & 4 deletions Runtime/Agents/EmergencyExitAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override async UniTask Run(CancellationToken token)
Selectable.AllSelectablesNoAlloc(selectables);
for (var i = 0; i < allSelectableCount; i++)
{
if (selectables[i].TryGetComponent<EmergencyExit>(out var emergencyExit))
if (selectables[i].TryGetComponent<EmergencyExitAnnotation>(out var emergencyExit))
{
ClickEmergencyExitButton(emergencyExit);
}
Expand All @@ -55,11 +55,11 @@ public override async UniTask Run(CancellationToken token)
}

[SuppressMessage("ReSharper", "SuggestBaseTypeForParameter")]
private void ClickEmergencyExitButton(EmergencyExit emergencyExit)
private void ClickEmergencyExitButton(EmergencyExitAnnotation emergencyExitAnnotation)
{
Logger.Log($"Click emergency exit button: {emergencyExit.name}");
Logger.Log($"Click emergency exit button: {emergencyExitAnnotation.name}");

var gameObject = emergencyExit.gameObject;
var gameObject = emergencyExitAnnotation.gameObject;
var button = gameObject.GetComponent<Button>();
button.OnPointerClick(new PointerEventData(EventSystem.current));
// Note: Button.OnPointerClick() does not look at PointerEventData coordinates.
Expand Down
2 changes: 1 addition & 1 deletion Tests/Runtime/Agents/EmergencyExitAgentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static SpyButton CreateButtonWithEmergencyExitAnnotation(bool interactab
{
var button = new GameObject().AddComponent<SpyButton>();
button.GetComponent<Selectable>().interactable = interactable;
button.gameObject.AddComponent<EmergencyExit>();
button.gameObject.AddComponent<EmergencyExitAnnotation>();
return button;
}

Expand Down

0 comments on commit 0550148

Please sign in to comment.