diff --git a/Assets/Prefabs/UI/Shop.prefab b/Assets/Prefabs/UI/Shop.prefab index 4b4cf56232f733cb9e62839b8c187fd06ccbb5df..f6af280e8e96b2f954fca9ace317b437c72b8009 100644 --- a/Assets/Prefabs/UI/Shop.prefab +++ b/Assets/Prefabs/UI/Shop.prefab @@ -104,7 +104,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 4454354353752636481} - {fileID: 4454354353357383106} m_Father: {fileID: 0} m_RootOrder: 0 @@ -121,6 +120,7 @@ GameObject: - component: {fileID: 4454354353357383117} - component: {fileID: 4454354353357383116} - component: {fileID: 4454354353357383107} + - component: {fileID: 3778963642214779494} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -141,8 +141,9 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4454354352845014725} + - {fileID: 4454354353752636481} m_Father: {fileID: 4454354353102500860} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -210,6 +211,27 @@ MonoBehaviour: m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 +--- !u!95 &3778963642214779494 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4454354353357383105} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 0} + m_CullingMode: 0 + m_UpdateMode: 1 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 --- !u!1 &4454354353752636480 GameObject: m_ObjectHideFlags: 0 @@ -235,13 +257,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4454354353752636480} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -640, y: -360, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 4454354353102500860} - m_RootOrder: 0 + m_Father: {fileID: 4454354353357383106} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &4454354353752636483 MonoBehaviour: diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index e86a4da5118eab8df0b808a5214ea94fe389bc43..3ec0c5c95087897efafe88a70dfa58da5f182fd0 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -262,7 +262,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 37.4, y: 18.704987} + m_AnchoredPosition: {x: 37.400024, y: 18.704956} m_SizeDelta: {x: 21.01, y: 21.01} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &38364363 @@ -790,11 +790,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5358109398903638710, guid: 49efbb0a3dbfa441b9f7d13ae10d034c, type: 3} propertyPath: m_LocalPosition.y - value: 1.8334874 + value: 1.8334885 objectReference: {fileID: 0} - target: {fileID: 5358109398903638710, guid: 49efbb0a3dbfa441b9f7d13ae10d034c, type: 3} propertyPath: m_LocalPosition.z - value: -2.5431516 + value: -2.543152 objectReference: {fileID: 0} - target: {fileID: 5358109398903638710, guid: 49efbb0a3dbfa441b9f7d13ae10d034c, type: 3} propertyPath: m_LocalRotation.w @@ -802,7 +802,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5358109398903638710, guid: 49efbb0a3dbfa441b9f7d13ae10d034c, type: 3} propertyPath: m_LocalRotation.x - value: 0.0348993 + value: 0.034899496 objectReference: {fileID: 0} - target: {fileID: 5358109398903638710, guid: 49efbb0a3dbfa441b9f7d13ae10d034c, type: 3} propertyPath: m_LocalRotation.y @@ -911,8 +911,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 272130433} - m_LocalRotation: {x: 0.0348993, y: 0, z: 0, w: 0.99939084} - m_LocalPosition: {x: 2.69, y: 1.8334874, z: -2.5431516} + m_LocalRotation: {x: 0.034899496, y: 0, z: 0, w: 0.99939084} + m_LocalPosition: {x: 2.69, y: 1.8334885, z: -2.543152} m_LocalScale: {x: 0.8575421, y: 0.8575421, z: 0.8575421} m_ConstrainProportionsScale: 0 m_Children: [] @@ -2614,7 +2614,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 122.66971, y: 18.704987} + m_AnchoredPosition: {x: 122.66968, y: 18.704956} m_SizeDelta: {x: 107.3394, y: 11.9641} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1944464827 @@ -2929,6 +2929,10 @@ PrefabInstance: propertyPath: gameOverManager value: objectReference: {fileID: 426447404} + - target: {fileID: 3502970855684404616, guid: dbe370de796fd504dbbaa8a080d9fa0b, type: 3} + propertyPath: weaponList.Array.data[1] + value: + objectReference: {fileID: 0} - target: {fileID: 3502970855684404618, guid: dbe370de796fd504dbbaa8a080d9fa0b, type: 3} propertyPath: m_Camera value: diff --git a/Assets/Scripts/Shop/ShopMenuController.cs b/Assets/Scripts/Shop/ShopMenuController.cs index bc88d7f7b72fc7f8017f7c42dcf2491db7f8f033..089958a7f3977e5ab0e98538b3f739f24029bd88 100644 --- a/Assets/Scripts/Shop/ShopMenuController.cs +++ b/Assets/Scripts/Shop/ShopMenuController.cs @@ -71,12 +71,13 @@ public class ShopMenuController : MonoBehaviour // read weapon and pet weaponlist = JsonUtility.FromJson<ShopItemList>(File.ReadAllText(weaponpath)); petlist = JsonUtility.FromJson<ShopItemList>(File.ReadAllText(petpath)); + PlayerController playerController = player.GetComponent<PlayerController>(); - FillData(weaponItem,weaponlist); - FillData(petItem,petlist); + FillData(weaponItem,weaponlist,playerController.weaponList, true); + FillData(petItem,petlist, new GameObject[4], false); } - private void FillData(List<VisualElement> itemlist, ShopItemList itemSourceList) + private void FillData(List<VisualElement> itemlist, ShopItemList itemSourceList, GameObject[] playerItem, bool isWeapon) { ShopItem selectItem(int index, ShopItemList clist){ switch (index) @@ -101,6 +102,23 @@ public class ShopMenuController : MonoBehaviour num++; } + + if (isWeapon) + { + for (int i = 0; i < playerItem.Length; i++) + { + if (playerItem[i] != null) + { + if (i == playerItem.Length-1) + { + break; + } + itemlist[i].Q<Button>("UpgradeButton").text = "Sold Out"; + itemlist[i].Q<Button>("UpgradeButton").focusable = false; + itemlist[i].Q<Button>("UpgradeButton").style.backgroundColor = Color.white; + } + } + } } private void UpgradeBtnClicked(ClickEvent evt, int num)