diff --git a/frontend/Savor-22b/Assets/Resources/Prefabs/EdibleSelector.prefab b/frontend/Savor-22b/Assets/Resources/Prefabs/EdibleSelector.prefab new file mode 100644 index 00000000..febb2462 --- /dev/null +++ b/frontend/Savor-22b/Assets/Resources/Prefabs/EdibleSelector.prefab @@ -0,0 +1,241 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4900593595793060818 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8308415236605114377} + - component: {fileID: 2242902317745967571} + - component: {fileID: 6029892636767148843} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8308415236605114377 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4900593595793060818} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1088665758286468086} + m_Father: {fileID: 385186927898626012} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 32.5, y: -32.5} + m_SizeDelta: {x: 65, y: 65} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2242902317745967571 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4900593595793060818} + m_CullTransparentMesh: 1 +--- !u!114 &6029892636767148843 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4900593595793060818} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &6061193885563917408 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1088665758286468086} + - component: {fileID: 41327420244241143} + - component: {fileID: 671256733987110606} + m_Layer: 5 + m_Name: Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1088665758286468086 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6061193885563917408} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8308415236605114377} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 65, y: 65} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &41327420244241143 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6061193885563917408} + m_CullTransparentMesh: 1 +--- !u!114 &671256733987110606 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6061193885563917408} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7278647243939426856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 385186927898626012} + - component: {fileID: 3165245302101188978} + m_Layer: 5 + m_Name: EdibleSelector + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &385186927898626012 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7278647243939426856} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8308415236605114377} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -65.9, y: 2.9} + m_SizeDelta: {x: 65, y: 65} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &3165245302101188978 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7278647243939426856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, 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: 1 + 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: 6029892636767148843} + toggleTransition: 1 + graphic: {fileID: 671256733987110606} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 1 diff --git a/frontend/Savor-22b/Assets/Resources/Prefabs/EdibleSelector.prefab.meta b/frontend/Savor-22b/Assets/Resources/Prefabs/EdibleSelector.prefab.meta new file mode 100644 index 00000000..9936437d --- /dev/null +++ b/frontend/Savor-22b/Assets/Resources/Prefabs/EdibleSelector.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryFood.prefab b/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryFood.prefab index 9e3e482f..33aa4706 100644 --- a/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryFood.prefab +++ b/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryFood.prefab @@ -480,141 +480,6 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: ---- !u!1 &5002311209692123916 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4468924430359739179} - - component: {fileID: 1469557504283567216} - - component: {fileID: 265989911504485972} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &4468924430359739179 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5002311209692123916} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6743753714614884991} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &1469557504283567216 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5002311209692123916} - m_CullTransparentMesh: 1 ---- !u!114 &265989911504485972 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5002311209692123916} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Button - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 762e54d57538641e19bc101e62d1f0bf, type: 2} - m_sharedMaterial: {fileID: 8824689001231509252, guid: 762e54d57538641e19bc101e62d1f0bf, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 24 - m_fontSizeBase: 24 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &5054959788434979280 GameObject: m_ObjectHideFlags: 0 @@ -775,128 +640,6 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Grade ---- !u!1 &6204629118425889036 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6743753714614884991} - - component: {fileID: 642421035768661775} - - component: {fileID: 3010317695275821083} - - component: {fileID: 5582433898982112786} - m_Layer: 5 - m_Name: NullButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &6743753714614884991 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6204629118425889036} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4468924430359739179} - m_Father: {fileID: 8005686026421526538} - m_RootOrder: 18 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 943.37, y: 589} - m_SizeDelta: {x: 160, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &642421035768661775 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6204629118425889036} - m_CullTransparentMesh: 1 ---- !u!114 &3010317695275821083 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6204629118425889036} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &5582433898982112786 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6204629118425889036} - 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: 1 - 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: 3010317695275821083} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &6651977305842926372 GameObject: m_ObjectHideFlags: 0 @@ -1314,7 +1057,7 @@ GameObject: - component: {fileID: 3135267446720511135} m_Layer: 5 m_Name: InventoryFood - m_TagString: Untagged + m_TagString: Edible m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -1349,7 +1092,7 @@ RectTransform: - {fileID: 3565623082870478232} - {fileID: 4240373225871329245} - {fileID: 4281271367060221341} - - {fileID: 6743753714614884991} + - {fileID: 2231879211992199156} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1436,7 +1179,7 @@ MonoBehaviour: speed: {fileID: 8156318147916209046} ingredientId: {fileID: 8064126439499043189} recipeId: {fileID: 8005686025981637035} - FoodCreateButton: {fileID: 5582433898982112786} + toggleButton: {fileID: 3480291835462355290} --- !u!1 &8005686026511830484 GameObject: m_ObjectHideFlags: 0 @@ -1839,3 +1582,124 @@ MonoBehaviour: m_Text: 'Defense ' +--- !u!1001 &1990959548421777448 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 8005686026421526538} + m_Modifications: + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_RootOrder + value: 18 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_SizeDelta.x + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_SizeDelta.y + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchoredPosition.x + value: 326.8 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchoredPosition.y + value: 15.327 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_IsOn + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7278647243939426856, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Name + value: EdibleSelector + objectReference: {fileID: 0} + - target: {fileID: 7278647243939426856, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} +--- !u!224 &2231879211992199156 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + m_PrefabInstance: {fileID: 1990959548421777448} + m_PrefabAsset: {fileID: 0} +--- !u!114 &3480291835462355290 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + m_PrefabInstance: {fileID: 1990959548421777448} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryIngredient.prefab b/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryIngredient.prefab index 30681162..bb6749c8 100644 --- a/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryIngredient.prefab +++ b/frontend/Savor-22b/Assets/Resources/Prefabs/InventoryIngredient.prefab @@ -31,7 +31,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 12 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -111,7 +111,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 11 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -191,7 +191,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 13 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -271,7 +271,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 9 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -353,7 +353,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -404,128 +404,6 @@ MonoBehaviour: m_Text: 'Attack ' ---- !u!1 &1711955333019873804 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8215055953206988200} - - component: {fileID: 4263602744573654304} - - component: {fileID: 3648415007123598575} - - component: {fileID: 1000976596707463680} - m_Layer: 5 - m_Name: CreateFoodButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &8215055953206988200 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1711955333019873804} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4944591535714682636} - m_Father: {fileID: 2197322282948509215} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -138.90936, y: 88} - m_SizeDelta: {x: 225.1888, y: 38.86} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &4263602744573654304 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1711955333019873804} - m_CullTransparentMesh: 1 ---- !u!114 &3648415007123598575 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1711955333019873804} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.120666504, g: 0, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &1000976596707463680 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1711955333019873804} - 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: 1 - 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: 3648415007123598575} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &2197322281025730005 GameObject: m_ObjectHideFlags: 0 @@ -557,7 +435,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -637,7 +515,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -717,7 +595,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -797,7 +675,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -861,7 +739,7 @@ GameObject: - component: {fileID: 5934646994767297232} m_Layer: 5 m_Name: InventoryIngredient - m_TagString: Untagged + m_TagString: Edible m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -878,7 +756,6 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 8215055953206988200} - {fileID: 2197322281025730002} - {fileID: 2197322282430584575} - {fileID: 2197322282770109406} @@ -893,6 +770,7 @@ RectTransform: - {fileID: 7914222952017793228} - {fileID: 1202048774141110954} - {fileID: 8974126803693175493} + - {fileID: 5263984697771564418} - {fileID: 3067569102597003321} - {fileID: 2413722841414179941} m_Father: {fileID: 0} @@ -981,7 +859,7 @@ MonoBehaviour: speed: {fileID: 24362820296885635} ingredientId: {fileID: 2197322282239160254} recipeId: {fileID: 2698895897781471610} - FoodCreateButton: {fileID: 1000976596707463680} + toggleButton: {fileID: 7473774829287947052} --- !u!1 &2673033039936561429 GameObject: m_ObjectHideFlags: 0 @@ -1093,7 +971,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1253,7 +1131,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1333,7 +1211,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 10 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1413,7 +1291,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 14 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1462,141 +1340,6 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: ---- !u!1 &8581605035113275222 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4944591535714682636} - - component: {fileID: 1517763044080978793} - - component: {fileID: 5059928933552279650} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &4944591535714682636 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8581605035113275222} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 8215055953206988200} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.25, y: -0.3050537} - m_SizeDelta: {x: 421.31006, y: 102.82994} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &1517763044080978793 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8581605035113275222} - m_CullTransparentMesh: 1 ---- !u!114 &5059928933552279650 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8581605035113275222} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Create Food - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 20 - m_fontSizeBase: 24 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 1 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &9027219875116930989 GameObject: m_ObjectHideFlags: 0 @@ -1628,7 +1371,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2197322282948509215} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1677,3 +1420,124 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: +--- !u!1001 &5500332520320899678 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2197322282948509215} + m_Modifications: + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_RootOrder + value: 14 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_SizeDelta.x + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_SizeDelta.y + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchoredPosition.x + value: 345.2 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchoredPosition.y + value: 23.432 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_IsOn + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7278647243939426856, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Name + value: EdibleSelector + objectReference: {fileID: 0} + - target: {fileID: 7278647243939426856, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} +--- !u!224 &5263984697771564418 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + m_PrefabInstance: {fileID: 5500332520320899678} + m_PrefabAsset: {fileID: 0} +--- !u!114 &7473774829287947052 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + m_PrefabInstance: {fileID: 5500332520320899678} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/frontend/Savor-22b/Assets/Resources/Prefabs/Recipe.prefab b/frontend/Savor-22b/Assets/Resources/Prefabs/Recipe.prefab index 3a65d4b1..9b2f8fd5 100644 --- a/frontend/Savor-22b/Assets/Resources/Prefabs/Recipe.prefab +++ b/frontend/Savor-22b/Assets/Resources/Prefabs/Recipe.prefab @@ -53,7 +53,7 @@ GameObject: - component: {fileID: 4670185320355692143} m_Layer: 5 m_Name: Recipe - m_TagString: Untagged + m_TagString: Recipe m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -78,6 +78,7 @@ RectTransform: - {fileID: 8378801435043883189} - {fileID: 8378801434339690296} - {fileID: 8378801436439102612} + - {fileID: 8878652910501631971} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -161,6 +162,8 @@ MonoBehaviour: minGrade: {fileID: 8378801435043883190} maxGrade: {fileID: 8378801436439102613} ingredients: [] + toggleButton: {fileID: 6161504191178256717} + recipeId: 0 --- !u!114 &4670185320355692143 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1097,8 +1100,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 767, y: -28.00003} - m_SizeDelta: {x: 194.74, y: 38.19} + m_AnchoredPosition: {x: 767, y: -27.500015} + m_SizeDelta: {x: 194.74, y: 37.19} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8378801435043883191 CanvasRenderer: @@ -1602,3 +1605,128 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1001 &9110565166293291071 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4882765270220713834} + m_Modifications: + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_RootOrder + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_SizeDelta.x + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_SizeDelta.y + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchoredPosition.x + value: 342 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_AnchoredPosition.y + value: 74.605 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_IsOn + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7278647243939426856, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_Name + value: EdibleSelector + objectReference: {fileID: 0} + - target: {fileID: 7278647243939426856, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} +--- !u!114 &6161504191178256717 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3165245302101188978, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + m_PrefabInstance: {fileID: 9110565166293291071} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!224 &8878652910501631971 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 385186927898626012, guid: 3a5b15b1a966b4dd8a9fb5e0dac37b99, type: 3} + m_PrefabInstance: {fileID: 9110565166293291071} + m_PrefabAsset: {fileID: 0} diff --git a/frontend/Savor-22b/Assets/Scenes/GeneralScene.unity b/frontend/Savor-22b/Assets/Scenes/GeneralScene.unity index ce0443e6..2b9fe6dd 100644 --- a/frontend/Savor-22b/Assets/Scenes/GeneralScene.unity +++ b/frontend/Savor-22b/Assets/Scenes/GeneralScene.unity @@ -1636,7 +1636,7 @@ GameObject: - component: {fileID: 1151395577} - component: {fileID: 1151395576} m_Layer: 5 - m_Name: ShowRecipe + m_Name: RecipeSelect m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1916,6 +1916,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1371177489} + - {fileID: 1704475678} m_Father: {fileID: 117835513} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1939,7 +1940,11 @@ MonoBehaviour: svrReference: {fileID: 11400000, guid: 38e7c9c0fffe34996ae8cf5c6c4417ee, type: 2} recipePrefab: {fileID: 4882765270220713835, guid: c7f5baa4302764c91a9f69f5ca88ac32, type: 3} recipeContent: {fileID: 1151223263} - originalJson: + recipeButton: {fileID: 1151395576} + combineButton: {fileID: 1388113826} + selectedRecipeId: 0 + toggleGroupObject: {fileID: 1704475677} + toggleGroup: {fileID: 1704475679} --- !u!114 &1297813464 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2099,6 +2104,7 @@ GameObject: - component: {fileID: 1388113828} - component: {fileID: 1388113827} - component: {fileID: 1388113826} + - component: {fileID: 1388113829} m_Layer: 5 m_Name: Combine m_TagString: Untagged @@ -2171,9 +2177,9 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} - m_TargetAssemblyTypeName: MenuManager, Assembly-CSharp - m_MethodName: CombineMenuOpen + - m_Target: {fileID: 1388113829} + m_TargetAssemblyTypeName: FoodGenerator, Assembly-CSharp + m_MethodName: CreateNewFood m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -2221,6 +2227,26 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1388113824} m_CullTransparentMesh: 1 +--- !u!114 &1388113829 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388113824} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c69157c5f5df4463198e1610fd652d1a, type: 3} + m_Name: + m_EditorClassIdentifier: + svrReference: {fileID: 11400000, guid: 38e7c9c0fffe34996ae8cf5c6c4417ee, type: 2} + privateKeyHex: + recipeId: 0 + refrigeratorIds: [] + recipeRendererObject: {fileID: 1297813461} + inventoryObject: {fileID: 2011812298} + recipeRenderer: {fileID: 0} + inventory: {fileID: 0} --- !u!224 &1417392055 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 7118656563000721105, guid: 8be7299c3760c433ca12df1b5245928a, type: 3} @@ -2356,6 +2382,56 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1474950334} m_CullTransparentMesh: 1 +--- !u!1 &1704475677 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1704475678} + - component: {fileID: 1704475679} + m_Layer: 5 + m_Name: ToggleGroup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1704475678 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1704475677} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1297813462} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1704475679 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1704475677} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2fafe2cfe61f6974895a912c3755e8f1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_AllowSwitchOff: 1 --- !u!1 &1710355008 GameObject: m_ObjectHideFlags: 0 @@ -2709,6 +2785,8 @@ MonoBehaviour: seedContent: {fileID: 527247175} ingredientContent: {fileID: 1752225784} foodContent: {fileID: 1949131118} + recipeButton: {fileID: 1151395576} + combineButton: {fileID: 1388113826} --- !u!1001 &7118656564412715366 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/frontend/Savor-22b/Assets/Scripts/Controllers.meta b/frontend/Savor-22b/Assets/Scripts/Controllers.meta new file mode 100644 index 00000000..c92a46e1 --- /dev/null +++ b/frontend/Savor-22b/Assets/Scripts/Controllers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2f23c6f06f3014fd4ba06b75daf26df1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/frontend/Savor-22b/Assets/Scripts/Controllers/FoodGenerator.cs b/frontend/Savor-22b/Assets/Scripts/Controllers/FoodGenerator.cs new file mode 100644 index 00000000..39f54d33 --- /dev/null +++ b/frontend/Savor-22b/Assets/Scripts/Controllers/FoodGenerator.cs @@ -0,0 +1,60 @@ +using GraphQlClient.Core; +using GraphQlClient.EventCallbacks; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.Networking; + +public class FoodGenerator : MonoBehaviour +{ + [Header("API")] + public GraphApi svrReference; + public string privateKeyHex; + public int recipeId; + public string[] refrigeratorIds; + + public GameObject recipeRendererObject; + public GameObject inventoryObject; + public RecipeRenderer recipeRenderer; + public ItemInventory inventory; + + public async void CreateNewFood() + { + GetDatas(); + if (recipeId == 0) + { + Debug.Log("Please select valid recipe"); + return; + } + if (refrigeratorIds.Length == 0) + { + Debug.Log("Please select refrigerator"); + } + + GraphApi.Query query = svrReference.GetQueryByName(QueryNames.CREATE_FOOD, GraphApi.Query.Type.Mutation); + + // argument must set exact same name in schema + query.SetArgs(new { privateKeyHex = privateKeyHex, recipeID = recipeId, refrigeratorStateIDs = refrigeratorIds }); + UnityWebRequest request = await svrReference.Post(query); + + recipeRenderer.ResetRecipeSelectors(); + } + + private void GetDatas() + { + // get private key, refrigerator ids + privateKeyHex = inventory.privateKeyHex; + //refrigeratorIds = inventory.GetStateIds().ToArray(); + refrigeratorIds = inventory.selectedStateIds.ToArray(); + + //get recipe id + recipeId = recipeRenderer.selectedRecipeId; + Debug.Log("Number of Edibles selected: " + refrigeratorIds.Length + "\n" + "recipe Id: " + recipeId); + } + + void Start() + { + //Setting inventory, recipe scripts + inventory = inventoryObject.GetComponent(); + recipeRenderer = recipeRendererObject.GetComponent(); + } +} diff --git a/frontend/Savor-22b/Assets/Scripts/Controllers/FoodGenerator.cs.meta b/frontend/Savor-22b/Assets/Scripts/Controllers/FoodGenerator.cs.meta new file mode 100644 index 00000000..abb7b01b --- /dev/null +++ b/frontend/Savor-22b/Assets/Scripts/Controllers/FoodGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c69157c5f5df4463198e1610fd652d1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/frontend/Savor-22b/Assets/Scripts/Foodselector.meta b/frontend/Savor-22b/Assets/Scripts/Foodselector.meta new file mode 100644 index 00000000..52f8ad27 --- /dev/null +++ b/frontend/Savor-22b/Assets/Scripts/Foodselector.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8f0abc7b022940faa7a9a30ae8dc7ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/frontend/Savor-22b/Assets/Scripts/Inventory/ItemInventory.cs b/frontend/Savor-22b/Assets/Scripts/Inventory/ItemInventory.cs index 4ca8097a..eeb3736c 100644 --- a/frontend/Savor-22b/Assets/Scripts/Inventory/ItemInventory.cs +++ b/frontend/Savor-22b/Assets/Scripts/Inventory/ItemInventory.cs @@ -1,7 +1,9 @@ using System.Net.WebSockets; +using System.Collections.Generic; using GraphQlClient.Core; using GraphQlClient.EventCallbacks; using UnityEngine; +using UnityEngine.UI; using UnityEngine.Networking; public class ItemInventory : MonoBehaviour @@ -25,21 +27,32 @@ public class ItemInventory : MonoBehaviour public RectTransform ingredientContent; public RectTransform foodContent; + public Button recipeButton; + public Button combineButton; + + private bool isRecipeSelector = false; + + + private Dictionary ingredientUIObjects; + private Dictionary foodUIObjects; + public List selectedStateIds; + private ClientWebSocket clientWebSocket; private Event.EventListener socketListener; + private void Start() + { + Subscribe(); + + SetInventorySelectorButton(); + } private void OnEnable() { socketListener = SocketDataReceiver.Receiver(SocketId, DisplayData); OnSubscriptionDataReceived.RegisterListener(socketListener); } - private void Start() - { - Subscribe(); - } - private void OnDisable() { OnSubscriptionDataReceived.UnregisterListener(socketListener); @@ -82,6 +95,7 @@ private void DrawSeedList(Seed[] seedStateList) private void DrawIngredientList(Refrigerator[] refrigeratorStateList) { + ingredientUIObjects = new Dictionary(); foreach (Refrigerator refrigerator in refrigeratorStateList) { if (refrigerator.ingredientId.HasValue) @@ -90,12 +104,27 @@ private void DrawIngredientList(Refrigerator[] refrigeratorStateList) RefrigeratorUI ingredientUIScript = ingredientUI.GetComponent(); ingredientUIScript.SetRefrigeratorData(refrigerator); + + ingredientUIScript.toggleButton.onValueChanged.AddListener(delegate { handleSelectInventoryButton(refrigerator.stateId.ToString()); }); + + GameObject toggle = ingredientUI.transform.Find("EdibleSelector").gameObject; + if (isRecipeSelector) + { + toggle.SetActive(true); + } + + if (!ingredientUIObjects.ContainsKey(refrigerator.stateId)) + { + ingredientUIObjects.Add(refrigerator.stateId, ingredientUI); + } + } } } private void DrawFoodList(Refrigerator[] foodStateList) { + foodUIObjects = new Dictionary(); foreach (Refrigerator refrigerator in foodStateList) { if (refrigerator.recipeId.HasValue) @@ -104,6 +133,19 @@ private void DrawFoodList(Refrigerator[] foodStateList) RefrigeratorUI foodUIScript = foodUI.GetComponent(); foodUIScript.SetRefrigeratorData(refrigerator); + + foodUIScript.toggleButton.onValueChanged.AddListener(delegate { handleSelectInventoryButton(refrigerator.stateId.ToString()); }); + + GameObject toggle = foodUI.transform.Find("EdibleSelector").gameObject; + if (isRecipeSelector) + { + toggle.SetActive(true); + } + + if (!foodUIObjects.ContainsKey(refrigerator.stateId)) + { + foodUIObjects.Add(refrigerator.stateId, foodUI); + } } } } @@ -112,11 +154,14 @@ public void DisplayData(OnSubscriptionDataReceived subscriptionDataReceived) { Inventory inventory = Inventory.CreateFromJSON(subscriptionDataReceived.data); - resetUIElements(); + if (!isRecipeSelector) + { + resetUIElements(); - DrawSeedList(inventory.seedStateList); - DrawIngredientList(inventory.refrigeratorStateList); - DrawFoodList(inventory.refrigeratorStateList); + DrawSeedList(inventory.seedStateList); + DrawIngredientList(inventory.refrigeratorStateList); + DrawFoodList(inventory.refrigeratorStateList); + } } public async void Subscribe() @@ -152,5 +197,131 @@ public async void CreateNewSeed() } + // Recipe edible selector + private void SetInventorySelectorButton() + { + recipeButton.onClick.AddListener(ToggleInventorySelector); + combineButton.onClick.AddListener(ResetSelectors); + } + + private void ToggleInventorySelector() + { + if (!isRecipeSelector) + { + ActivateInventorySelector(); + } + else + { + DeactivateInventorySelector(); + } + } + + private void ActivateInventorySelector() + { + foreach (var kvp in ingredientUIObjects) + { + GameObject refrigeratorUI = kvp.Value; + if (refrigeratorUI != null) + { + Transform inventorySelectorTransform = refrigeratorUI.transform.Find("EdibleSelector"); + if (inventorySelectorTransform != null) + { + GameObject edibleToggle = inventorySelectorTransform.gameObject; + edibleToggle.SetActive(true); + } + } + + } + foreach (var kvp in foodUIObjects) + { + GameObject refrigeratorUI = kvp.Value; + if (refrigeratorUI != null) + { + Transform inventorySelectorTransform = refrigeratorUI.transform.Find("EdibleSelector"); + if (inventorySelectorTransform != null) + { + GameObject edibleToggle = inventorySelectorTransform.gameObject; + edibleToggle.SetActive(true); + } + } + + } + + isRecipeSelector = true; + } + + private void DeactivateInventorySelector() + { + foreach (var kvp in ingredientUIObjects) + { + GameObject refrigeratorUI = kvp.Value; + if (refrigeratorUI != null) + { + Transform inventorySelectorTransform = refrigeratorUI.transform.Find("EdibleSelector"); + if (inventorySelectorTransform != null) + { + GameObject edibleToggle = inventorySelectorTransform.gameObject; + edibleToggle.SetActive(false); + } + } + } + foreach (var kvp in foodUIObjects) + { + GameObject refrigeratorUI = kvp.Value; + if (refrigeratorUI != null) + { + Transform inventorySelectorTransform = refrigeratorUI.transform.Find("EdibleSelector"); + if (inventorySelectorTransform != null) + { + GameObject edibleToggle = inventorySelectorTransform.gameObject; + edibleToggle.SetActive(false); + } + } + } + + isRecipeSelector = false; + } + + private void ResetSelectors() + { + foreach (var kvp in ingredientUIObjects) + { + GameObject refrigeratorUI = kvp.Value; + Transform inventorySelectorTransform = refrigeratorUI.transform.Find("EdibleSelector"); + if (inventorySelectorTransform != null) + { + GameObject edibleToggle = inventorySelectorTransform.gameObject; + Toggle toggle = edibleToggle.GetComponent(); + toggle.isOn = false; + } + } + foreach (var kvp in foodUIObjects) + { + GameObject refrigeratorUI = kvp.Value; + Transform inventorySelectorTransform = refrigeratorUI.transform.Find("EdibleSelector"); + if (inventorySelectorTransform != null) + { + GameObject edibleToggle = inventorySelectorTransform.gameObject; + Toggle toggle = edibleToggle.GetComponent(); + toggle.isOn = false; + } + } + DeactivateInventorySelector(); + + selectedStateIds = new List(); + } + + private void handleSelectInventoryButton(string stateId) + { + if (selectedStateIds.Contains(stateId)) + { + selectedStateIds.Remove(stateId); + } + else + { + selectedStateIds.Add(stateId); + } + } + } diff --git a/frontend/Savor-22b/Assets/Scripts/Inventory/RefrigeratorUI.cs b/frontend/Savor-22b/Assets/Scripts/Inventory/RefrigeratorUI.cs index 5174d4a6..8497e8af 100644 --- a/frontend/Savor-22b/Assets/Scripts/Inventory/RefrigeratorUI.cs +++ b/frontend/Savor-22b/Assets/Scripts/Inventory/RefrigeratorUI.cs @@ -14,7 +14,8 @@ public class RefrigeratorUI : MonoBehaviour public Text ingredientId; public Text recipeId; - public Button FoodCreateButton; + public Toggle toggleButton; + public void SetRefrigeratorData(Refrigerator refrigerator) { @@ -27,18 +28,5 @@ public void SetRefrigeratorData(Refrigerator refrigerator) ingredientId.text = refrigerator.ingredientId.ToString(); recipeId.text = refrigerator.recipeId.ToString(); - - //SetFoodCreateButton(refrigerator.stateId); } - - // public void CreateFood(Guid stateId) - // { - // Debug.Log("Create food"); - // } - - // public void SetFoodCreateButton(Guid stateId) - // { - // FoodCreateButton.onClick.AddListener(() => CreateFood(stateId)); - // } - } diff --git a/frontend/Savor-22b/Assets/Scripts/Models/QueryNames.cs b/frontend/Savor-22b/Assets/Scripts/Models/QueryNames.cs index 7a2a9e6c..14e3cc7c 100644 --- a/frontend/Savor-22b/Assets/Scripts/Models/QueryNames.cs +++ b/frontend/Savor-22b/Assets/Scripts/Models/QueryNames.cs @@ -4,4 +4,5 @@ public static class QueryNames { public static readonly string GET_ALL_RECIPE = "GetAllRecipe"; public static readonly string CREATE_INGREDIENT = "CreateNewIngredient"; + public static readonly string CREATE_FOOD = "CreateNewFood"; } diff --git a/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeRenderer.cs b/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeRenderer.cs index dc047c84..97979ac1 100644 --- a/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeRenderer.cs +++ b/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeRenderer.cs @@ -2,6 +2,7 @@ using GraphQlClient.Core; using GraphQlClient.EventCallbacks; using UnityEngine; +using UnityEngine.UI; using UnityEngine.Networking; using System.Collections.Generic; @@ -16,14 +17,20 @@ public class RecipeRenderer : MonoBehaviour [Header("UI Containers")] public RectTransform recipeContent; - private void DrawRecipeList(List recipeList) + public Button recipeButton; + public Button combineButton; + + private bool isRecipeSelector = false; + public int selectedRecipeId; + private Dictionary recipeUIObjects = new Dictionary(); + + public GameObject toggleGroupObject; + public ToggleGroup toggleGroup; + + void Start() { - foreach (Recipe recipe in recipeList) - { - GameObject recipeUI = Instantiate(recipePrefab, recipeContent); - RecipeUI recipeUIComponent = recipeUI.GetComponent(); - recipeUIComponent.SetRecipe(recipe); - } + GetAllRecipes(); + SetRecipeSelectorButton(); } public async void GetAllRecipes() @@ -35,6 +42,26 @@ public async void GetAllRecipes() } + private void DrawRecipeList(List recipeList) + { + foreach (Recipe recipe in recipeList) + { + GameObject recipeUI = Instantiate(recipePrefab, recipeContent); + RecipeUI recipeUIComponent = recipeUI.GetComponent(); + recipeUIComponent.SetRecipe(recipe); + + //group the toggles + recipeUIComponent.toggleButton.group = toggleGroup; + + //setting listner for FoodGenerator + recipeUIComponent.toggleButton.onValueChanged.AddListener(delegate { handleSelectRecipeButton(recipe.id); }); + + recipeUIObjects.Add(recipe.id, recipeUI); + } + } + + + public void DisplayData(string data) { List recipes = Recipe.CreateFromJSON(data); @@ -42,11 +69,74 @@ public void DisplayData(string data) DrawRecipeList(recipes); } - void Start() + private void SetRecipeSelectorButton() { - GetAllRecipes(); + recipeButton.onClick.AddListener(ToggleRecipeSelector); + combineButton.onClick.AddListener(DeactivateRecipeSelector); + + } + + private void ToggleRecipeSelector() + { + if (!isRecipeSelector) + { + ActivateRecipeSelector(); + } + else + { + DeactivateRecipeSelector(); + } + } + + private void ActivateRecipeSelector() + { + foreach (var kvp in recipeUIObjects) + { + GameObject recipeUI = kvp.Value; + Transform recipeToggleTransform = recipeUI.transform.Find("EdibleSelector"); + if (recipeToggleTransform != null) + { + GameObject recipeToggle = recipeToggleTransform.gameObject; + recipeToggle.SetActive(true); + } + } + isRecipeSelector = true; } + private void DeactivateRecipeSelector() + { + foreach (var kvp in recipeUIObjects) + { + GameObject recipeUI = kvp.Value; + Transform recipeToggleTransform = recipeUI.transform.Find("EdibleSelector"); + if (recipeToggleTransform != null) + { + GameObject recipeToggle = recipeToggleTransform.gameObject; + recipeToggle.SetActive(false); + } + } + isRecipeSelector = false; + } + // handler for FoodGenerator + private void handleSelectRecipeButton(int recipeId) + { + selectedRecipeId = recipeId; + } + + public void ResetRecipeSelectors() + { + foreach (var kvp in recipeUIObjects) + { + GameObject recipeUI = kvp.Value; + Transform recipeToggleTransform = recipeUI.transform.Find("EdibleSelector"); + if (recipeToggleTransform != null) + { + GameObject recipeToggle = recipeToggleTransform.gameObject; + Toggle toggle = recipeToggle.GetComponent(); + toggle.isOn = false; + } + } + } } diff --git a/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeUI.cs b/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeUI.cs index 8ed78278..971c648e 100644 --- a/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeUI.cs +++ b/frontend/Savor-22b/Assets/Scripts/Recipe/RecipeUI.cs @@ -12,6 +12,11 @@ public class RecipeUI : MonoBehaviour public IngredientType[] ingredients; + public Toggle toggleButton; + + public int recipeId; + + public void SetRecipe(Recipe recipe) { id.text = recipe.id.ToString(); @@ -19,5 +24,7 @@ public void SetRecipe(Recipe recipe) minGrade.text = recipe.minGrade; maxGrade.text = recipe.maxGrade; ingredients = recipe.ingredients; + + recipeId = recipe.id; } } diff --git a/frontend/Savor-22b/Assets/Scripts/SavorReference.asset b/frontend/Savor-22b/Assets/Scripts/SavorReference.asset index 1684fce9..da79b36e 100644 --- a/frontend/Savor-22b/Assets/Scripts/SavorReference.asset +++ b/frontend/Savor-22b/Assets/Scripts/SavorReference.asset @@ -348,9 +348,10 @@ MonoBehaviour: isComplete: 1 - name: CreateNewFood type: 1 - query: - queryString: stage - returnType: + query: "mutation CreateNewFood{\n generateFood{\n id\n nonce\n + signer\n }\n}" + queryString: generateFood + returnType: Transaction queryOptions: - stage - transferAsset @@ -358,8 +359,89 @@ MonoBehaviour: - generateSeed - generateIngredient - generateFood - fields: [] - isComplete: 0 + fields: + - index: 0 + name: id + type: ID + parentIndexes: + hasSubField: 0 + possibleFields: + - name: id + type: ID + - name: nonce + type: Long + - name: signer + type: Address + - name: publicKey + type: ByteString + - name: updatedAddresses + type: Address + - name: signature + type: ByteString + - name: timestamp + type: DateTimeOffset + - name: actions + type: Action + - name: serializedPayload + type: String + - name: blockRef + type: Block + hasChanged: 0 + - index: 1 + name: nonce + type: Long + parentIndexes: + hasSubField: 0 + possibleFields: + - name: id + type: ID + - name: nonce + type: Long + - name: signer + type: Address + - name: publicKey + type: ByteString + - name: updatedAddresses + type: Address + - name: signature + type: ByteString + - name: timestamp + type: DateTimeOffset + - name: actions + type: Action + - name: serializedPayload + type: String + - name: blockRef + type: Block + hasChanged: 0 + - index: 2 + name: signer + type: Address + parentIndexes: + hasSubField: 0 + possibleFields: + - name: id + type: ID + - name: nonce + type: Long + - name: signer + type: Address + - name: publicKey + type: ByteString + - name: updatedAddresses + type: Address + - name: signature + type: ByteString + - name: timestamp + type: DateTimeOffset + - name: actions + type: Action + - name: serializedPayload + type: String + - name: blockRef + type: Block + hasChanged: 0 + isComplete: 1 subscriptions: - name: ReadAllSeed type: 2 diff --git a/frontend/Savor-22b/ProjectSettings/TagManager.asset b/frontend/Savor-22b/ProjectSettings/TagManager.asset index 83cb8079..68f0419e 100644 --- a/frontend/Savor-22b/ProjectSettings/TagManager.asset +++ b/frontend/Savor-22b/ProjectSettings/TagManager.asset @@ -3,7 +3,9 @@ --- !u!78 &1 TagManager: serializedVersion: 2 - tags: [] + tags: + - Edible + - Recipe layers: - Default - TransparentFX