fixed first Shop Slot

started on shop switcher button (for animal shop)
This commit is contained in:
dhain 2022-06-23 15:01:13 +02:00
parent b0ab924037
commit acd602c85a
11 changed files with 286 additions and 143 deletions

View file

@ -248,7 +248,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 6 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -573,11 +573,6 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3}
--- !u!224 &109441210 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
m_PrefabInstance: {fileID: 5121261192963321214}
m_PrefabAsset: {fileID: 0}
--- !u!1 &131335458 --- !u!1 &131335458
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -973,7 +968,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -1042,7 +1037,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 1520388888} - {fileID: 1520388888}
m_Father: {fileID: 1203044072} m_Father: {fileID: 1203044072}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
@ -1988,8 +1983,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 2006577139} m_TargetGraphic: {fileID: 2006577139}
m_HandleRect: {fileID: 2006577138} m_HandleRect: {fileID: 2006577138}
m_Direction: 2 m_Direction: 2
m_Value: 0.9999999 m_Value: 0.9999998
m_Size: 0.5386614 m_Size: 0.59851277
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
@ -2848,7 +2843,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 7 value: 6
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -3604,7 +3599,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 5 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -5170,7 +5165,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -5344,6 +5339,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 656110741} - {fileID: 656110741}
- {fileID: 1785473025} - {fileID: 1785473025}
- {fileID: 1566847388}
- {fileID: 157569880} - {fileID: 157569880}
m_Father: {fileID: 1671356617} m_Father: {fileID: 1671356617}
m_RootOrder: 0 m_RootOrder: 0
@ -5621,7 +5617,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -5798,6 +5794,82 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 3510585822996971025, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3} m_CorrespondingSourceObject: {fileID: 3510585822996971025, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3}
m_PrefabInstance: {fileID: 1197657129} m_PrefabInstance: {fileID: 1197657129}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1271600640
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1271600641}
- component: {fileID: 1271600643}
- component: {fileID: 1271600642}
m_Layer: 0
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1271600641
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271600640}
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: 1566847388}
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: 16, y: 16}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1271600642
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271600640}
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: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: e2bde586482642d44a270276574c0129, type: 3}
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!222 &1271600643
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271600640}
m_CullTransparentMesh: 1
--- !u!1 &1278234712 --- !u!1 &1278234712
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -6654,7 +6726,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 8 value: 7
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -6956,7 +7028,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 9 value: 8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -7379,6 +7451,155 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 3510585822996971025, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3} m_CorrespondingSourceObject: {fileID: 3510585822996971025, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3}
m_PrefabInstance: {fileID: 1126497628} m_PrefabInstance: {fileID: 1126497628}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1566847387
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1566847388}
- component: {fileID: 1566847392}
- component: {fileID: 1566847391}
- component: {fileID: 1566847390}
- component: {fileID: 1566847389}
m_Layer: 0
m_Name: SwitchShopButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1566847388
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566847387}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.0640067, y: 1.0640067, z: 1.0640067}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1271600641}
m_Father: {fileID: 1203044072}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 82.5, y: 292.75}
m_SizeDelta: {x: -225, y: -604.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1566847389
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566847387}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 47545d0c6734b804c9407d5752a08ee4, type: 3}
m_Name:
m_EditorClassIdentifier:
animalShopSprite: {fileID: 0}
itemShopSprite: {fileID: 0}
--- !u!114 &1566847390
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566847387}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 0
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: 1566847391}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1671356619}
m_TargetAssemblyTypeName: Shop, Assembly-CSharp
m_MethodName: UndoLastPurchase
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!114 &1566847391
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566847387}
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: 21300000, guid: 349d3f5d7a4156146b8e923d5c06314d, type: 3}
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!222 &1566847392
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566847387}
m_CullTransparentMesh: 1
--- !u!1 &1609015285 --- !u!1 &1609015285
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -8927,7 +9148,6 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 109441210}
- {fileID: 1222314751} - {fileID: 1222314751}
- {fileID: 156055822} - {fileID: 156055822}
- {fileID: 1195314499} - {fileID: 1195314499}
@ -9858,7 +10078,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 4 value: 3
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} - target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
@ -9895,104 +10115,3 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3} m_CorrespondingSourceObject: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
m_PrefabInstance: {fileID: 2142219637} m_PrefabInstance: {fileID: 2142219637}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1001 &5121261192963321214
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1985691912}
m_Modifications:
- target: {fileID: 5121261193055935939, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: UseItem
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935940, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5121261193055935943, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}
propertyPath: m_Name
value: ShopSlot
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2279fa2b47ef2ce40af9052d3a3f438b, type: 3}

View file

@ -2,7 +2,8 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class ElementStorage<T> : MonoBehaviour { public class ElementStorage<T> : MonoBehaviour {
public Dictionary<T, int> elements; private Dictionary<T, int> _elements;
public Dictionary<T, int> Elements => _elements;
public T[] startElements; public T[] startElements;
/** /**
@ -12,7 +13,7 @@ public class ElementStorage<T> : MonoBehaviour {
public OnElementChanged onElementChangedCallback; public OnElementChanged onElementChangedCallback;
private void Start() { private void Start() {
elements ??= new Dictionary<T, int>(); _elements ??= new Dictionary<T, int>();
foreach(T element in startElements) { foreach(T element in startElements) {
AddElement(element, 1); AddElement(element, 1);
} }
@ -22,10 +23,10 @@ public class ElementStorage<T> : MonoBehaviour {
* Adds the specified amount of elements to the Element Storage * Adds the specified amount of elements to the Element Storage
*/ */
public virtual void AddElement(T element, int amount) { public virtual void AddElement(T element, int amount) {
if(!elements.ContainsKey(element)) { if(!_elements.ContainsKey(element)) {
elements.Add(element, amount); _elements.Add(element, amount);
} else { } else {
elements[element] += amount; _elements[element] += amount;
} }
onElementChangedCallback?.Invoke(); onElementChangedCallback?.Invoke();
@ -35,10 +36,10 @@ public class ElementStorage<T> : MonoBehaviour {
* Removes the specified amount of elements in the Element Storage * Removes the specified amount of elements in the Element Storage
*/ */
public virtual void RemoveElement(T element, int amount) { public virtual void RemoveElement(T element, int amount) {
if(elements[element]-amount <= 0) { if(_elements[element]-amount <= 0) {
elements.Remove(element); _elements.Remove(element);
} else { } else {
elements[element] -= amount; _elements[element] -= amount;
} }
onElementChangedCallback?.Invoke(); onElementChangedCallback?.Invoke();

View file

@ -73,7 +73,7 @@ public class ElementStorageSlot<T> : MonoBehaviour, IPointerEnterHandler, IPoint
* Clears the Element Storage Slot * Clears the Element Storage Slot
*/ */
public virtual void ClearSlot() { public virtual void ClearSlot() {
_element = default(T); _element = default;
icon.sprite = null; icon.sprite = null;
icon.enabled = false; icon.enabled = false;
amountText.text = ""; amountText.text = "";

View file

@ -97,7 +97,7 @@ public class FishingController : MonoBehaviour {
} }
public void StartFishing() { public void StartFishing() {
if (!_iv.elements.ContainsKey(_ic.GetItemByName("Bait"))) { if (!_iv.Elements.ContainsKey(_ic.GetItemByName("Bait"))) {
_messageView.SendMessage("No bait!", 1.0f); _messageView.SendMessage("No bait!", 1.0f);
return; return;
} }

View file

@ -23,14 +23,14 @@ public class Inventory : ElementStorage<Item> {
* Adds the specified amount of items to the Inventory * Adds the specified amount of items to the Inventory
*/ */
public override void AddElement(Item item, int amount) { public override void AddElement(Item item, int amount) {
if (elements.Count >= _InventorySpace) { if (Elements.Count >= _InventorySpace) {
Debug.Log("Not enough inventory space!"); Debug.Log("Not enough inventory space!");
return; return;
} }
// Sell overflowing Items // Sell overflowing Items
if (elements.ContainsKey(item) && elements[item] + amount >= _MaxItemStack) { if (Elements.ContainsKey(item) && Elements[item] + amount >= _MaxItemStack) {
SellItem(item, amount - (_MaxItemStack - elements[item])); SellItem(item, amount - (_MaxItemStack - Elements[item]));
amount = _MaxItemStack - elements[item]; amount = _MaxItemStack - Elements[item];
} }
base.AddElement(item, amount); base.AddElement(item, amount);
} }
@ -40,7 +40,7 @@ public class Inventory : ElementStorage<Item> {
*/ */
public override void RemoveElement(Item item, int amount) { public override void RemoveElement(Item item, int amount) {
base.RemoveElement(item, amount); base.RemoveElement(item, amount);
if (!elements.ContainsKey(item) && PlayerController.instance.SelectedItem == item) { if (!Elements.ContainsKey(item) && PlayerController.instance.SelectedItem == item) {
PlayerController.instance.DeselectItem(); PlayerController.instance.DeselectItem();
} }
} }

View file

@ -48,10 +48,10 @@ public class InventoryUI : MonoBehaviour {
private void UpdateUI() { private void UpdateUI() {
// Add all items to the correct slots, clear the ones where no item should be and set the number of how many items are in the slot // Add all items to the correct slots, clear the ones where no item should be and set the number of how many items are in the slot
for(int i = 0; i < _slots.Length; i++) { for(int i = 0; i < _slots.Length; i++) {
if(i < _inventory.elements.Count) { if(i < _inventory.Elements.Count) {
_slots[i].AddElement(_inventory.elements.ElementAt(i).Key); _slots[i].AddElement(_inventory.Elements.ElementAt(i).Key);
_slots[i].amountText.text = "" + _inventory.elements[_inventory.elements.ElementAt(i).Key]; _slots[i].amountText.text = "" + _inventory.Elements[_inventory.Elements.ElementAt(i).Key];
if(_inventory.elements[_inventory.elements.ElementAt(i).Key] == 1) { if(_inventory.Elements[_inventory.Elements.ElementAt(i).Key] == 1) {
_slots[i].amountText.text = ""; _slots[i].amountText.text = "";
} }
} else { } else {

View file

@ -33,7 +33,7 @@ public class PlayerController : MonoBehaviour {
public UsableItem SelectedItem { public UsableItem SelectedItem {
get => _selectedItem; get => _selectedItem;
set { set {
if(_inventory.elements.ContainsKey(value)) { if(_inventory.Elements.ContainsKey(value)) {
_selectedItem = value; _selectedItem = value;
Cursor.SetCursor(value.defaultSprite.texture, Vector2.zero, CursorMode.Auto); Cursor.SetCursor(value.defaultSprite.texture, Vector2.zero, CursorMode.Auto);
} else { } else {

View file

@ -22,7 +22,6 @@ public class ShopSlot : ElementStorageSlot<Item> {
nameText.text = ""; nameText.text = "";
costText.text = ""; costText.text = "";
amountText.text = ""; amountText.text = "";
// _shop.RemoveItem(Item, 1);
base.ClearSlot(); base.ClearSlot();
} }

View file

@ -0,0 +1,13 @@
using UnityEngine;
public class ShopSwitcher : MonoBehaviour {
public Sprite animalShopSprite;
public Sprite itemShopSprite;
public void SwitchShops() {
// switch text in Shop Title
// switch image on switch Button
// turn off one content and turn on the other
// remove undo purchase button when switching to an animal shop
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 47545d0c6734b804c9407d5752a08ee4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -46,11 +46,11 @@ public class ShopUI : MonoBehaviour {
private void UpdateUI() { private void UpdateUI() {
// Add all items to the correct slots and clear the ones where no item should be // Add all items to the correct slots and clear the ones where no item should be
for (int i = 0; i < _slots.Length; i++) { for (int i = 0; i < _slots.Length; i++) {
if (i < _shop.elements.Count) { if (i < _shop.Elements.Count) {
_slots[i].AddElement(_shop.elements.ElementAt(i).Key); _slots[i].AddElement(_shop.Elements.ElementAt(i).Key);
_slots[i].nameText.text = _slots[i].Element.displayName; _slots[i].nameText.text = _slots[i].Element.displayName;
_slots[i].costText.text = _slots[i].Element.price + " µ"; _slots[i].costText.text = _slots[i].Element.price + " µ";
_slots[i].amountText.text = _shop.elements[_shop.elements.ElementAt(i).Key] + " #"; _slots[i].amountText.text = _shop.Elements[_shop.Elements.ElementAt(i).Key] + " #";
} }
else { else {
_slots[i].ClearSlot(); _slots[i].ClearSlot();