public static void CreateSkipButton(ButtonUtils.ButtonLocation location = ButtonUtils.ButtonLocation.Menu) { if (PlaylistManager.state != PlaylistManager.PlaylistState.Endless) { return; } if (location != ButtonUtils.ButtonLocation.Pause && location != ButtonUtils.ButtonLocation.Failed) { return; } string name = "InGameUI/ShellPage_EndGameContinue/page/ShellPanel_Center/exit"; Vector3 localPosition = favButtonInGameUIPosition; Vector3 rotation = favButtonInGameUIRotation; Action listener = new Action(() => { OnInGameSkipButtonShot(); }); if (location == ButtonUtils.ButtonLocation.Failed) { name = "InGameUI/ShellPage_Failed/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.Pause) { name = "InGameUI/ShellPage_Pause/page/ShellPanel_Center/exit"; } var refButton = GameObject.Find(name); GameObject button = GameObject.Instantiate(refButton, refButton.transform.parent.transform); if (location == ButtonUtils.ButtonLocation.Menu) { skipButton = button; } ButtonUtils.InitButton(button, "Skip Song", listener, localPosition, rotation); }
public static void CreateDeleteButton(ButtonUtils.ButtonLocation location = ButtonUtils.ButtonLocation.Menu) { // can only reuse the menu button, InGameUI gets recreated each time if (location == ButtonUtils.ButtonLocation.Menu && delete != null) { delete.SetActive(true); UpdateButtonEnabled(deleteButton, deleteText); return; } string name = "InGameUI/ShellPage_EndGameContinue/page/ShellPanel_Center/exit"; Vector3 localPosition = delButtonInGameUIPosition; Vector3 rotation = delButtonInGameUIRotation; Action listener = new Action(() => { OnInGameUIDeleteButtonShot(); }); if (location == ButtonUtils.ButtonLocation.Failed) { name = "InGameUI/ShellPage_Failed/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.Pause) { name = "InGameUI/ShellPage_Pause/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.PracticeModeOver) { name = "InGameUI/ShellPage_PracticeModeOver/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.Menu) { name = "menu/ShellPage_Launch/page/backParent/back"; listener = new Action(() => { OnDeleteButtonShot(); }); localPosition = delButtonMenuPosition; rotation = delButtonMenuRotation; } var refButton = GameObject.Find(name); GameObject button = GameObject.Instantiate(refButton, refButton.transform.parent.transform); GunButton gunButton = button.GetComponentInChildren <GunButton>(); TextMeshPro tmp = button.GetComponentInChildren <TextMeshPro>(); ButtonUtils.InitButton(button, "Delete", listener, localPosition, rotation); UpdateButtonEnabled(gunButton, tmp); if (location == ButtonUtils.ButtonLocation.Menu) { delete = button; deleteButton = gunButton; deleteText = tmp; } }
public static void CreatePlaylistButton(ButtonUtils.ButtonLocation location = ButtonUtils.ButtonLocation.Menu) { if (PlaylistManager.state == PlaylistManager.PlaylistState.Endless) { return; } // can only reuse the menu button, InGameUI gets recreated each time if (location == ButtonUtils.ButtonLocation.Menu && playlistButton != null) { UpdateLabel(); playlistButton.SetActive(true); return; } string name = "InGameUI/ShellPage_EndGameContinue/page/ShellPanel_Center/exit"; Vector3 localPosition = playlistButtonInGameUIPosition; Vector3 rotation = playlistButtonInGameUIRotation; Action listener = new Action(() => { OnIngamePlaylistButtonShot(); }); if (location == ButtonUtils.ButtonLocation.Failed) { name = "InGameUI/ShellPage_Failed/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.Pause) { name = "InGameUI/ShellPage_Pause/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.PracticeModeOver) { name = "InGameUI/ShellPage_PracticeModeOver/page/ShellPanel_Center/exit"; } else if (location == ButtonUtils.ButtonLocation.Menu) { name = "menu/ShellPage_Launch/page/backParent/back"; listener = new Action(() => { OnPlaylistButtonShot(); }); localPosition = playlistButtonMenuPosition; rotation = playlistButtonMenuRotation; } var refButton = GameObject.Find(name); GameObject button = GameObject.Instantiate(refButton, refButton.transform.parent.transform); if (location == ButtonUtils.ButtonLocation.Menu) { playlistButton = button; } ButtonUtils.InitButton(button, "Add to Playlist", listener, localPosition, rotation); }