diff --git a/Assets/KJM/KJMprefabs/Confirm Panel.prefab b/Assets/KJM/KJMprefabs/Confirm Panel.prefab index d0469d8..afc3620 100644 --- a/Assets/KJM/KJMprefabs/Confirm Panel.prefab +++ b/Assets/KJM/KJMprefabs/Confirm Panel.prefab @@ -67,8 +67,8 @@ MonoBehaviour: m_Calls: [] m_text: messege text m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -334,8 +334,8 @@ MonoBehaviour: m_Calls: [] m_text: Button m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] diff --git a/Assets/KJM/KJMprefabs/ScrollItem/GiboScrollItem.prefab b/Assets/KJM/KJMprefabs/ScrollItem/GiboScrollItem.prefab index 346d9ae..6860a22 100644 --- a/Assets/KJM/KJMprefabs/ScrollItem/GiboScrollItem.prefab +++ b/Assets/KJM/KJMprefabs/ScrollItem/GiboScrollItem.prefab @@ -65,10 +65,10 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Name + m_text: "\uC774\uB984" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -201,8 +201,8 @@ MonoBehaviour: m_Calls: [] m_text: 00:00:00 m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -491,3 +491,5 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 446a80ba82242004eb31339c44f8ac3b, type: 3} m_Name: m_EditorClassIdentifier: + profileSprites: + - {fileID: 21300000, guid: edeacd6d8f6ab0d42bbdf4ada3c61a27, type: 3} diff --git a/Assets/KJM/KJMprefabs/ScrollItem/RankingScrollItem.prefab b/Assets/KJM/KJMprefabs/ScrollItem/RankingScrollItem.prefab index 8c2e71c..d9cca60 100644 --- a/Assets/KJM/KJMprefabs/ScrollItem/RankingScrollItem.prefab +++ b/Assets/KJM/KJMprefabs/ScrollItem/RankingScrollItem.prefab @@ -65,10 +65,10 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: name + m_text: "\uC774\uB984" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -199,10 +199,10 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: winRate + m_text: "\uC2B9\uB960" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -491,3 +491,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e2c72577a3d9f7b479c7bac6a8f65048, type: 3} m_Name: m_EditorClassIdentifier: + profileSprites: + - {fileID: 21300000, guid: 2d325c545f7c9144cb37a45e93e5ddb9, type: 3} + - {fileID: 21300000, guid: 59492a1d9c2719641bd0d4d53988c9b4, type: 3} diff --git a/Assets/KJM/KJMprefabs/ScrollItem/ShopScrollItem.prefab b/Assets/KJM/KJMprefabs/ScrollItem/ShopScrollItem.prefab index 3c3be0e..95132c3 100644 --- a/Assets/KJM/KJMprefabs/ScrollItem/ShopScrollItem.prefab +++ b/Assets/KJM/KJMprefabs/ScrollItem/ShopScrollItem.prefab @@ -67,8 +67,8 @@ MonoBehaviour: m_Calls: [] m_text: 6COIN m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -199,10 +199,10 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Price + m_text: "1000\uC6D0" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -491,3 +491,5 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4d28917ad20c19e428cbf98ba5609e69, type: 3} m_Name: m_EditorClassIdentifier: + profileSprites: + - {fileID: 21300000, guid: 307bff9630735f342852f28b1cd5d300, type: 3} diff --git a/Assets/KJM/KJMprefabs/Setting Panel.prefab b/Assets/KJM/KJMprefabs/Setting Panel.prefab index ceb06ac..2920e89 100644 --- a/Assets/KJM/KJMprefabs/Setting Panel.prefab +++ b/Assets/KJM/KJMprefabs/Setting Panel.prefab @@ -310,10 +310,10 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: BGM + m_text: "\uBC30\uACBD\uC74C\uC545" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -1233,10 +1233,10 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: SFX + m_text: "\uD6A8\uACFC\uC74C" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 85a19688db53c77469fc4406b01045da, type: 2} + m_sharedMaterial: {fileID: -2477908578676791210, guid: 85a19688db53c77469fc4406b01045da, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] diff --git a/Assets/KJM/KimJaeMin.unity b/Assets/KJM/KimJaeMin.unity index 9f52925..fa10f57 100644 --- a/Assets/KJM/KimJaeMin.unity +++ b/Assets/KJM/KimJaeMin.unity @@ -294,6 +294,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 03aef985a8b802a409630fdcab7be09b, type: 3} m_Name: m_EditorClassIdentifier: + settingsPanel: {fileID: 2861881646994438329, guid: ea820246b5075c54d9f614291ca41c5d, type: 3} + confirmPanel: {fileID: 8145365568262946399, guid: 76f1fe6b5243faf4f9b8caee7312d336, type: 3} + rankingPanel: {fileID: 154459105952450598, guid: bf4bb18aa323fe748b3eb1d537503596, type: 3} + shopPanel: {fileID: 8190964574954487140, guid: eb257b0a685b2254f860f294ce8cba54, type: 3} + giboPanel: {fileID: 3090474328172188941, guid: c63914e01332f8d479ada92325335e41, type: 3} + _canvas: {fileID: 6741227126671320411} --- !u!222 &71273024816384741 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Script/Game/GameManager.cs b/Assets/Script/Game/GameManager.cs index 5d05d8d..3122658 100644 --- a/Assets/Script/Game/GameManager.cs +++ b/Assets/Script/Game/GameManager.cs @@ -21,7 +21,6 @@ public class GameManager : Singleton private StoneController _stoneController; private Canvas _canvas; - public Sprite[] profileSprites; //스크롤 패널에서 사용할 테스트 배열 private void Awake() { diff --git a/Assets/Script/UI/PanelChildController/GiboItemController.cs b/Assets/Script/UI/PanelChildController/GiboItemController.cs index eba7e4c..8e4dc33 100644 --- a/Assets/Script/UI/PanelChildController/GiboItemController.cs +++ b/Assets/Script/UI/PanelChildController/GiboItemController.cs @@ -7,6 +7,7 @@ using UnityEngine.UI; public class GiboItemController : MonoBehaviour { GiboItem _giboItem; + public Sprite[] profileSprites; public void Init(GiboItem giboItem) { _giboItem = giboItem; @@ -14,7 +15,7 @@ public class GiboItemController : MonoBehaviour var itemImage = GetComponentsInChildren()[1]; var itemText = GetComponentsInChildren(); - itemImage.sprite = GameManager.Instance.profileSprites[this._giboItem.WinLoseSpriteIndex]; + itemImage.sprite = profileSprites[this._giboItem.WinLoseSpriteIndex]; itemText[0].text = this._giboItem.Date; itemText[1].text = this._giboItem.Name; } diff --git a/Assets/Script/UI/PanelChildController/RankingItemController.cs b/Assets/Script/UI/PanelChildController/RankingItemController.cs index 1b2e1a3..6792f4a 100644 --- a/Assets/Script/UI/PanelChildController/RankingItemController.cs +++ b/Assets/Script/UI/PanelChildController/RankingItemController.cs @@ -7,13 +7,15 @@ using UnityEngine.UI; public class RankingItemController : MonoBehaviour { RankingItem _rankingItem; + public Sprite[] profileSprites; + public void Init(RankingItem rankingItem) { _rankingItem = rankingItem; var itemImage = GetComponentsInChildren()[1]; var itemText = GetComponentsInChildren(); - itemImage.sprite = GameManager.Instance.profileSprites[this._rankingItem.ProfileSpriteIndex]; + itemImage.sprite = profileSprites[this._rankingItem.ProfileSpriteIndex]; itemText[0].text = this._rankingItem.Name; itemText[1].text = this._rankingItem.WinRate.ToString(); } diff --git a/Assets/Script/UI/PanelChildController/ShopItemController.cs b/Assets/Script/UI/PanelChildController/ShopItemController.cs index 87b6184..dd02af1 100644 --- a/Assets/Script/UI/PanelChildController/ShopItemController.cs +++ b/Assets/Script/UI/PanelChildController/ShopItemController.cs @@ -7,13 +7,15 @@ using UnityEngine.UI; public class ShopItemController : MonoBehaviour { ShopItem _shopItem; + public Sprite[] profileSprites; + public void Init(ShopItem shopItem) { _shopItem = shopItem; var itemImage = GetComponentsInChildren()[1]; var itemText = GetComponentsInChildren(); - itemImage.sprite = GameManager.Instance.profileSprites[this._shopItem.ItemSpriteIndex]; + itemImage.sprite = profileSprites[this._shopItem.ItemSpriteIndex]; itemText[0].text = this._shopItem.Name; itemText[1].text = this._shopItem.Price; } diff --git a/Assets/Script/UI/PanelController/TestPanelController.cs b/Assets/Script/UI/PanelController/TestPanelController.cs index 603b58d..4630256 100644 --- a/Assets/Script/UI/PanelController/TestPanelController.cs +++ b/Assets/Script/UI/PanelController/TestPanelController.cs @@ -11,20 +11,78 @@ using Random = UnityEngine.Random; /// public class TestPanelController : MonoBehaviour { + //게임매니저 없이 동작하도록 작성한 테스트 코드 + [SerializeField] private GameObject settingsPanel; + [SerializeField] private GameObject confirmPanel; + [SerializeField] private GameObject rankingPanel; + [SerializeField] private GameObject shopPanel; + [SerializeField] private GameObject giboPanel; + public Canvas _canvas; + public void OpenConfirmPanel(string message, ConfirmPanelController.OnConfirmButtonClick onConfirmButtonClick) + { + if (_canvas != null) + { + var confirmPanelObject = Instantiate(confirmPanel, _canvas.transform); + confirmPanelObject.GetComponent() + .Show(message, onConfirmButtonClick); + } + } + + public void OpenSettingsPanel() + { + if (_canvas != null) + { + var settingsPanelObject = Instantiate(settingsPanel, _canvas.transform); + settingsPanelObject.GetComponent().Show(); + } + } + + public void OpenRankingPanel(List rankingItems) + { + if (_canvas != null) + { + var settingsPanelObject = Instantiate(rankingPanel, _canvas.transform); + settingsPanelObject.GetComponent().Show(rankingItems); + } + } + + public void OpenShopPanel(List shopItems) + { + if (_canvas != null) + { + var settingsPanelObject = Instantiate(shopPanel, _canvas.transform); + settingsPanelObject.GetComponent().Show(shopItems); + } + } + + public void OpenGiboPanel(List giboItems) + { + if (_canvas != null) + { + var settingsPanelObject = Instantiate(giboPanel, _canvas.transform); + settingsPanelObject.GetComponent().Show(giboItems); + } + } + + + + //확인 패널 생성 public void OnConfirmPanelClick() { - GameManager.Instance.OpenConfirmPanel("확인 패널 입니다.", () => + OpenConfirmPanel("확인 패널 입니다.", () => { Debug.Log("확인 버튼을 누르셨습니다."); }); return; } + //세팅 패널 생성 public void OnSettingPanelClick() { - GameManager.Instance.OpenSettingsPanel(); + OpenSettingsPanel(); } + //랭킹 패널 생성 public void OnRankingPanelClick() { @@ -40,9 +98,10 @@ public class TestPanelController : MonoBehaviour rankingItems.Add(rankingItem); } - GameManager.Instance.OpenRankingPanel(rankingItems); + OpenRankingPanel(rankingItems); } + //상점 패널 생성 public void OnShopPanelClick() { @@ -51,16 +110,17 @@ public class TestPanelController : MonoBehaviour { ShopItem shopItem = new ShopItem { - ItemSpriteIndex = Random.Range(0, 2), + ItemSpriteIndex = Random.Range(0, 1), Name = i.ToString(), Price = (i * 1000)+ "원" }; shopItems.Add(shopItem); } - GameManager.Instance.OpenShopPanel(shopItems); + OpenShopPanel(shopItems); } + //기보 패널 생성 public void OnGiboPanelClick() { @@ -69,7 +129,7 @@ public class TestPanelController : MonoBehaviour { GiboItem giboItem = new GiboItem { - WinLoseSpriteIndex = Random.Range(0, 2), + WinLoseSpriteIndex = Random.Range(0, 1), Date = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), Name = i.ToString(), }; @@ -77,7 +137,7 @@ public class TestPanelController : MonoBehaviour giboItems.Add(giboItem); } - GameManager.Instance.OpenGiboPanel(giboItems); + OpenGiboPanel(giboItems); }