diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Prefabs/Frame.prefab b/popcorn/Assets/MyGame/Scenes/recipe/Prefabs/Frame.prefab index adfb0b92..a0bbf16c 100644 --- a/popcorn/Assets/MyGame/Scenes/recipe/Prefabs/Frame.prefab +++ b/popcorn/Assets/MyGame/Scenes/recipe/Prefabs/Frame.prefab @@ -504,6 +504,7 @@ GameObject: m_Component: - component: {fileID: 2929932627350163026} - component: {fileID: 1570337604946174006} + - component: {fileID: 5490177795204899762} m_Layer: 0 m_Name: Frame m_TagString: Untagged @@ -550,7 +551,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + 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} @@ -571,10 +572,28 @@ MonoBehaviour: m_SelectedTrigger: Selected m_DisabledTrigger: Disabled m_Interactable: 1 - m_TargetGraphic: {fileID: 0} + m_TargetGraphic: {fileID: 1785032438920414220} m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!114 &5490177795204899762 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2929932627350163027} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 47bc31a2c7d14478bd4ebe3c32e41185, type: 3} + m_Name: + m_EditorClassIdentifier: + detailButton: {fileID: 1570337604946174006} + flavorName: {fileID: 2929932626752093611} + flavorPrice: {fileID: 2929932627123125673} + cornAmountText: {fileID: 6296255899301773980} + flavor1AmountText: {fileID: 2929932625557648441} + flavor2AmountText: {fileID: 367551539734858426} --- !u!1 &2997770120253274331 GameObject: m_ObjectHideFlags: 0 @@ -612,7 +631,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} m_AnchoredPosition: {x: 0, y: -100} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 172, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &3788395727770399120 MonoBehaviour: @@ -670,7 +689,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &5518194748275484553 RectTransform: m_ObjectHideFlags: 0 @@ -798,10 +817,10 @@ RectTransform: m_Father: {fileID: 9097260142390357153} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 50} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 108, y: 0} + m_SizeDelta: {x: 128, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7841468932949581945 CanvasRenderer: @@ -876,10 +895,10 @@ RectTransform: m_Father: {fileID: 9097260142390357153} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 42} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 19, y: 0} + m_SizeDelta: {x: 38, y: 42} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8472150098743274780 CanvasRenderer: @@ -928,7 +947,7 @@ PrefabInstance: - target: {fileID: 2814970099097301152, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} propertyPath: m_Name - value: MaterialFrame + value: MaterialFrame1 objectReference: {fileID: 0} - target: {fileID: 2814970099097301152, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} @@ -1093,6 +1112,18 @@ PrefabInstance: m_RemovedComponents: - {fileID: 2814970099097301159, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} m_SourcePrefab: {fileID: 100100000, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} +--- !u!114 &2929932625557648441 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2814970099411582468, guid: e2818e79d8fc1f34388aff1b8969d340, + type: 3} + m_PrefabInstance: {fileID: 1133216431126940221} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &2929932625336302236 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 2814970099097301153, guid: e2818e79d8fc1f34388aff1b8969d340, @@ -1109,7 +1140,7 @@ PrefabInstance: - target: {fileID: 2814970099097301152, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} propertyPath: m_Name - value: MaterialFrame (1) + value: MaterialFrame2 objectReference: {fileID: 0} - target: {fileID: 2814970099097301153, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} @@ -1264,6 +1295,18 @@ PrefabInstance: m_RemovedComponents: - {fileID: 2814970099097301159, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} m_SourcePrefab: {fileID: 100100000, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} +--- !u!114 &367551539734858426 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2814970099411582468, guid: e2818e79d8fc1f34388aff1b8969d340, + type: 3} + m_PrefabInstance: {fileID: 2452498385069847742} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &367551539495355423 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 2814970099097301153, guid: e2818e79d8fc1f34388aff1b8969d340, @@ -1280,7 +1323,7 @@ PrefabInstance: - target: {fileID: 2814970099097301152, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} propertyPath: m_Name - value: MaterialFrame (2) + value: CornAmount objectReference: {fileID: 0} - target: {fileID: 2814970099097301153, guid: e2818e79d8fc1f34388aff1b8969d340, type: 3} @@ -1436,3 +1479,15 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 8101979052737494168} m_PrefabAsset: {fileID: 0} +--- !u!114 &6296255899301773980 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2814970099411582468, guid: e2818e79d8fc1f34388aff1b8969d340, + type: 3} + m_PrefabInstance: {fileID: 8101979052737494168} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts.meta b/popcorn/Assets/MyGame/Scenes/recipe/Scripts.meta new file mode 100644 index 00000000..0652d787 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 677f8f5cfef694b24a98e4462d9d3768 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs new file mode 100644 index 00000000..3b016dcf --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs @@ -0,0 +1,12 @@ +namespace MyGame.Scenes.recipe.Scripts +{ + public class RecipeData + { + public int RecipeId; + public string Name; + public int Price; + public int CornAmount; + public int Flavor1Amount; + public int Flavor2Amount; + } +} \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs.meta b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs.meta new file mode 100644 index 00000000..f3e6eb2f --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5193219b46d047b595b22809e43804a1 +timeCreated: 1628058980 \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeView.cs b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeView.cs new file mode 100644 index 00000000..1576f4a0 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeView.cs @@ -0,0 +1,33 @@ +using System; +using MyGame.Scenes.recipe.Scripts; +using UniRx; +using UnityEngine; +using UnityEngine.UI; + +public class RecipeView : MonoBehaviour +{ + [SerializeField] private Button detailButton; + [SerializeField] private Text flavorName; + [SerializeField] private Text flavorPrice; + [SerializeField] private Text cornAmountText; + [SerializeField] private Text flavor1AmountText; + [SerializeField] private Text flavor2AmountText; + private static readonly string amountFormat = "x{0}"; + + private void Start() + { + detailButton.OnClickAsObservable().Subscribe(_ => + { + // open detail + }).AddTo(this); + } + + public void SetRecipe(RecipeData data) + { + flavorName.text = data.Name; + flavorPrice.text = data.Price.ToString(); + cornAmountText.text = string.Format(amountFormat, data.CornAmount); + flavor1AmountText.text = string.Format(amountFormat, data.Flavor1Amount); + flavor2AmountText.text = string.Format(amountFormat, data.Flavor2Amount); + } +} diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeView.cs.meta b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeView.cs.meta new file mode 100644 index 00000000..8f438277 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 47bc31a2c7d14478bd4ebe3c32e41185 +timeCreated: 1628059076 \ No newline at end of file