Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Prevent defining Button class breaking CyanEmu. (Should fix Noodle Bo…
Browse files Browse the repository at this point in the history
…wl imports)
  • Loading branch information
CyanLaser committed Jul 4, 2021
1 parent d832959 commit 37e44e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CyanEmu/Scripts/CyanEmuPlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
using VRC.SDKBase;
using System.Reflection;

// Noodle bowl defines its own button class, which would break CyanEmu.
// Ensuring button is properly defined with this using statement.
using UIButton = UnityEngine.UI.Button;

#if UDON
using VRC.Udon;
using VRC.Udon.Common;
Expand Down Expand Up @@ -297,7 +301,7 @@ private void CreateMenu()
respawnButton.transform.SetParent(menu_.transform, false);
respawnButton.transform.localPosition = new Vector3(60, 0, 0);
respawnButton.AddComponent<Image>();
Button button = respawnButton.AddComponent<Button>();
UIButton button = respawnButton.AddComponent<UIButton>();
button.onClick.AddListener(Respawn);

GameObject respawnText = new GameObject("RespawnText");
Expand All @@ -319,7 +323,7 @@ private void CreateMenu()
exitMenuButton.transform.SetParent(menu_.transform, false);
exitMenuButton.transform.localPosition = new Vector3(-60, 0, 0);
exitMenuButton.AddComponent<Image>();
button = exitMenuButton.AddComponent<Button>();
button = exitMenuButton.AddComponent<UIButton>();
button.onClick.AddListener(CloseMenu);

GameObject exitMenuText = new GameObject("ExitMenuText");
Expand Down

0 comments on commit 37e44e2

Please sign in to comment.