From b85ca4a248dcf85ce979a65e29391f502f6221c7 Mon Sep 17 00:00:00 2001 From: Luna <62033805+Luna5ama@users.noreply.github.com> Date: Thu, 6 Oct 2022 15:38:48 -0400 Subject: [PATCH] Fixed UIGame.inventory invalid field access --- PersonalLogistics.csproj | 2 +- PersonalLogisticsPlugin.cs | 2 +- Scripts/RecycleWindow.cs | 4 ++-- Scripts/RequesterWindow.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PersonalLogistics.csproj b/PersonalLogistics.csproj index e247e48..e670fd9 100644 --- a/PersonalLogistics.csproj +++ b/PersonalLogistics.csproj @@ -50,7 +50,7 @@ - + diff --git a/PersonalLogisticsPlugin.cs b/PersonalLogisticsPlugin.cs index ef1b866..70405a7 100644 --- a/PersonalLogisticsPlugin.cs +++ b/PersonalLogisticsPlugin.cs @@ -289,7 +289,7 @@ private void InitUi() _objectsToDestroy.Add(newButton.gameObject); } - if (UIRoot.instance.uiGame.inventory != null && newButton != null) + if (UIRoot.instance.uiGame.inventoryWindow != null && newButton != null) { _initted = true; } diff --git a/Scripts/RecycleWindow.cs b/Scripts/RecycleWindow.cs index afb6c3d..ab35a3c 100644 --- a/Scripts/RecycleWindow.cs +++ b/Scripts/RecycleWindow.cs @@ -93,7 +93,7 @@ private void Update() Log.Debug("Instantiating Recycle window"); var prefab = Asset.bundle.LoadAsset("Assets/Prefab/Player Inventory Recycle.prefab"); - var uiGameInventory = UIRoot.instance.uiGame.inventory; + var uiGameInventory = UIRoot.instance.uiGame.inventoryWindow; _storageComponent = new StorageComponent(10); _instanceGo = Instantiate(prefab, uiGameInventory.transform, false); @@ -217,7 +217,7 @@ private void AddShowRecycleCheck() chxGO = new GameObject("displayRecycleWindowCheck"); RectTransform checkBoxRectTransform = chxGO.AddComponent(); - checkBoxRectTransform.SetParent(UIRoot.instance.uiGame.inventory.transform, false); + checkBoxRectTransform.SetParent(UIRoot.instance.uiGame.inventoryWindow.transform, false); checkBoxRectTransform.anchorMax = new Vector2(0, 1); checkBoxRectTransform.anchorMin = new Vector2(0, 1); diff --git a/Scripts/RequesterWindow.cs b/Scripts/RequesterWindow.cs index c883946..b80e997 100644 --- a/Scripts/RequesterWindow.cs +++ b/Scripts/RequesterWindow.cs @@ -36,7 +36,7 @@ private void Update() { var prefab = Asset.bundle.LoadAsset("Assets/prefab/Request Window.prefab"); Log.Debug($"Instantiating Requester window -- prefab == null {prefab == null}"); - var uiGameInventory = UIRoot.instance.uiGame.inventory; + var uiGameInventory = UIRoot.instance.uiGame.inventoryWindow; _instanceGo = Instantiate(prefab, uiGameInventory.transform.parent, false); uiItemRequestWindow = _instanceGo.GetComponent(); if (!uiItemRequestWindow.created && !uiItemRequestWindow.destroyed)