瀏覽代碼

Fixed acquiring the right play button.
Removed some comments.

Stephen Damm 6 年之前
父節點
當前提交
f7d29bc23c
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 3 3
      SongBrowserPlugin/UI/SongBrowserUI.cs
  2. 1 1
      SongBrowserPlugin/UI/UIBuilder.cs

+ 3 - 3
SongBrowserPlugin/UI/SongBrowserUI.cs

@@ -109,8 +109,8 @@ namespace SongBrowserPlugin.UI
                     _levelListTableView = this._levelListViewController.GetComponentInChildren<StandardLevelListTableView>();
                 }
 
-                _playButton = Resources.FindObjectsOfTypeAll<Button>().First(x => (x.name == "PlayButton"));
-                               
+                _playButton = _levelDetailViewController.GetComponentsInChildren<Button>().FirstOrDefault(x => x.name == "PlayButton");
+
                 _simpleDialogPromptViewControllerPrefab = Resources.FindObjectsOfTypeAll<SimpleDialogPromptViewController>().First();
 
                 this._deleteDialog = UnityEngine.Object.Instantiate<SimpleDialogPromptViewController>(this._simpleDialogPromptViewControllerPrefab);
@@ -161,7 +161,7 @@ namespace SongBrowserPlugin.UI
                 float buttonWidth = 14.0f;
                 float buttonHeight = 5.0f;
                 float buttonX = -61;
-                float buttonY = 77.0f;
+                float buttonY = 74.5f;
 
                 string[] buttonNames = new string[]
                 {

+ 1 - 1
SongBrowserPlugin/UI/UIBuilder.cs

@@ -162,7 +162,7 @@ namespace SongBrowserPlugin.UI
         /// <returns></returns>
         public static Button CreateBackButton(RectTransform parent)
         {
-            Button dismissButton = CreateUIButton(parent, "BackArrowButton");  //UnityEngine.Object.Instantiate(Resources.FindObjectsOfTypeAll<Button>().First(x => (x.name == "BackArrowButton")), parent, false);
+            Button dismissButton = CreateUIButton(parent, "BackArrowButton");
             dismissButton.onClick.RemoveAllListeners();            
             return dismissButton;
         }