상점 ui 작업 완료
This commit is contained in:
parent
ef05920969
commit
fe3520deb3
|
|
@ -6,13 +6,27 @@ using UnityEngine.UI;
|
||||||
|
|
||||||
public class ShopType1itemPrefab : MonoBehaviour
|
public class ShopType1itemPrefab : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
//추상화 시킬것
|
||||||
[SerializeField] Image img;
|
[SerializeField] Image img;
|
||||||
[SerializeField] TMP_Text pay;
|
[SerializeField] TMP_Text pay;
|
||||||
|
|
||||||
|
ShopItemData shopItemData;
|
||||||
|
|
||||||
public void Set(ShopItemData shopItemData)
|
public void Set(ShopItemData shopItemData)
|
||||||
{
|
{
|
||||||
//img.sprite = null;
|
//img.sprite = null;
|
||||||
//골드인지 다른아이탬인지 구분 가능하게 만들것.
|
//골드인지 다른아이탬인지 구분 가능하게 만들것.
|
||||||
pay.text = "₩" + shopItemData.buy.ToString();
|
pay.text = "₩" + shopItemData.buy.ToString();
|
||||||
|
this.shopItemData = shopItemData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void BuyItemButton()
|
||||||
|
{
|
||||||
|
BuyShopItemResp resp = new BuyShopItemResp();
|
||||||
|
resp.Request((data) =>
|
||||||
|
{
|
||||||
|
Debug.Log("아이템 구매 성공");
|
||||||
|
}, shopItemData.index);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,28 @@ using UnityEngine.UI;
|
||||||
|
|
||||||
public class ShopType2itemPrefab : MonoBehaviour
|
public class ShopType2itemPrefab : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
//추상화 시킬것
|
||||||
[SerializeField] Image img;
|
[SerializeField] Image img;
|
||||||
[SerializeField] TMP_Text pay;
|
[SerializeField] TMP_Text pay;
|
||||||
[SerializeField] TMP_Text name;
|
[SerializeField] TMP_Text name;
|
||||||
|
|
||||||
|
ShopItemData shopItemData;
|
||||||
public void Set(ShopItemData shopItemData)
|
public void Set(ShopItemData shopItemData)
|
||||||
{
|
{
|
||||||
//img.sprite = null;
|
//img.sprite = null;
|
||||||
//골드인지 다른아이탬인지 구분 가능하게 만들것.
|
//골드인지 다른아이탬인지 구분 가능하게 만들것.
|
||||||
name.text = shopItemData.name;
|
name.text = shopItemData.name;
|
||||||
pay.text = "₩" + shopItemData.buy.ToString();
|
pay.text = "₩" + shopItemData.buy.ToString();
|
||||||
|
|
||||||
|
this.shopItemData = shopItemData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void BuyItemButton()
|
||||||
|
{
|
||||||
|
BuyShopItemResp resp = new BuyShopItemResp();
|
||||||
|
resp.Request((data) =>
|
||||||
|
{
|
||||||
|
Debug.Log("아이템 구매 성공");
|
||||||
|
}, shopItemData.index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using static UnityEditorInternal.ReorderableList;
|
|
||||||
|
|
||||||
public class ShopUiType2 : MonoBehaviour
|
public class ShopUiType2 : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ public enum Protocol
|
||||||
EquipChange = 200,//장비 변경
|
EquipChange = 200,//장비 변경
|
||||||
DeckChange = 201,//장비 변경
|
DeckChange = 201,//장비 변경
|
||||||
NicknameChange = 202,//닉네임 변경
|
NicknameChange = 202,//닉네임 변경
|
||||||
|
|
||||||
|
BuyShopItem = 300,//»óÁ¡ ¾ÆÀÌÅÛ ±¸¸Å
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 100 : Downlode
|
#region 100 : Downlode
|
||||||
|
|
@ -163,6 +165,39 @@ public class NicknameChangeResp : Request<NicknameChangeResp>
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 300 : BuyShopItem
|
||||||
|
public class BuyShopItemReq
|
||||||
|
{
|
||||||
|
public string uuid { get; set; }
|
||||||
|
public long shopItemIndex { get; set; }
|
||||||
|
|
||||||
|
public BuyShopItemReq(long shopItemIndex)
|
||||||
|
{
|
||||||
|
this.uuid = Statics.uuid;
|
||||||
|
this.shopItemIndex = shopItemIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BuyShopItemResp : Request<BuyShopItemResp>
|
||||||
|
{
|
||||||
|
private Protocol protocol = Protocol.BuyShopItem;
|
||||||
|
|
||||||
|
public long addGold { get; set; }
|
||||||
|
public long addCash { get; set; }
|
||||||
|
public long gold { get; set; }
|
||||||
|
public long cash { get; set; }
|
||||||
|
public List<DeckUnitInfo> deck_unit { get; set; }
|
||||||
|
public List<Equipment> equipment { get; set; }
|
||||||
|
public List<ConsumableItem> consumableItem { get; set; }
|
||||||
|
public List<EtcItem> etcItem { get; set; }
|
||||||
|
|
||||||
|
public void Request(Action<BuyShopItemResp> onRequestFinished, long shopItemIndex)
|
||||||
|
{
|
||||||
|
CreateRequest(protocol, onRequestFinished, new BuyShopItemReq(shopItemIndex), HTTPMethods.Post, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public class DynamicData
|
public class DynamicData
|
||||||
{
|
{
|
||||||
public long id { get; set; }
|
public long id { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ MonoBehaviour:
|
||||||
m_SelectOnDown: {fileID: 0}
|
m_SelectOnDown: {fileID: 0}
|
||||||
m_SelectOnLeft: {fileID: 0}
|
m_SelectOnLeft: {fileID: 0}
|
||||||
m_SelectOnRight: {fileID: 0}
|
m_SelectOnRight: {fileID: 0}
|
||||||
m_Transition: 1
|
m_Transition: 0
|
||||||
m_Colors:
|
m_Colors:
|
||||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
|
@ -390,4 +390,16 @@ MonoBehaviour:
|
||||||
m_TargetGraphic: {fileID: 5280038741001587855}
|
m_TargetGraphic: {fileID: 5280038741001587855}
|
||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1195781108577846382}
|
||||||
|
m_TargetAssemblyTypeName: ShopType1itemPrefab, Assembly-CSharp
|
||||||
|
m_MethodName: BuyItemButton
|
||||||
|
m_Mode: 1
|
||||||
|
m_Arguments:
|
||||||
|
m_ObjectArgument: {fileID: 0}
|
||||||
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
|
m_IntArgument: 0
|
||||||
|
m_FloatArgument: 0
|
||||||
|
m_StringArgument:
|
||||||
|
m_BoolArgument: 0
|
||||||
|
m_CallState: 2
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ GameObject:
|
||||||
- component: {fileID: 1146796107906926329}
|
- component: {fileID: 1146796107906926329}
|
||||||
- component: {fileID: 5953193668229128879}
|
- component: {fileID: 5953193668229128879}
|
||||||
- component: {fileID: 7961383756849831554}
|
- component: {fileID: 7961383756849831554}
|
||||||
|
- component: {fileID: 6986180686345204904}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: ShopType2item
|
m_Name: ShopType2item
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -95,6 +96,62 @@ MonoBehaviour:
|
||||||
img: {fileID: 3606121146902547572}
|
img: {fileID: 3606121146902547572}
|
||||||
pay: {fileID: 1677653462229980409}
|
pay: {fileID: 1677653462229980409}
|
||||||
name: {fileID: 4897647290955996531}
|
name: {fileID: 4897647290955996531}
|
||||||
|
--- !u!114 &6986180686345204904
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3117075481896632455}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Navigation:
|
||||||
|
m_Mode: 3
|
||||||
|
m_WrapAround: 0
|
||||||
|
m_SelectOnUp: {fileID: 0}
|
||||||
|
m_SelectOnDown: {fileID: 0}
|
||||||
|
m_SelectOnLeft: {fileID: 0}
|
||||||
|
m_SelectOnRight: {fileID: 0}
|
||||||
|
m_Transition: 0
|
||||||
|
m_Colors:
|
||||||
|
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||||
|
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||||
|
m_ColorMultiplier: 1
|
||||||
|
m_FadeDuration: 0.1
|
||||||
|
m_SpriteState:
|
||||||
|
m_HighlightedSprite: {fileID: 0}
|
||||||
|
m_PressedSprite: {fileID: 0}
|
||||||
|
m_SelectedSprite: {fileID: 0}
|
||||||
|
m_DisabledSprite: {fileID: 0}
|
||||||
|
m_AnimationTriggers:
|
||||||
|
m_NormalTrigger: Normal
|
||||||
|
m_HighlightedTrigger: Highlighted
|
||||||
|
m_PressedTrigger: Pressed
|
||||||
|
m_SelectedTrigger: Selected
|
||||||
|
m_DisabledTrigger: Disabled
|
||||||
|
m_Interactable: 1
|
||||||
|
m_TargetGraphic: {fileID: 5953193668229128879}
|
||||||
|
m_OnClick:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 7961383756849831554}
|
||||||
|
m_TargetAssemblyTypeName: ShopType2itemPrefab, Assembly-CSharp
|
||||||
|
m_MethodName: BuyItemButton
|
||||||
|
m_Mode: 1
|
||||||
|
m_Arguments:
|
||||||
|
m_ObjectArgument: {fileID: 0}
|
||||||
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
|
m_IntArgument: 0
|
||||||
|
m_FloatArgument: 0
|
||||||
|
m_StringArgument:
|
||||||
|
m_BoolArgument: 0
|
||||||
|
m_CallState: 2
|
||||||
--- !u!1 &3642106185150480029
|
--- !u!1 &3642106185150480029
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue