Add Shop module
Add Shop panel & saving module
This commit is contained in:
parent
d90ca46069
commit
88ab6bcee7
@ -28,6 +28,7 @@ RectTransform:
|
|||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 5110571134592049265}
|
- {fileID: 5110571134592049265}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
@ -130,6 +131,7 @@ RectTransform:
|
|||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0.95, y: 4.5, z: 1}
|
m_LocalScale: {x: 0.95, y: 4.5, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 5110571134455525713}
|
m_Father: {fileID: 5110571134455525713}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
|
@ -28,6 +28,7 @@ RectTransform:
|
|||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1.2, y: 6, z: 1}
|
m_LocalScale: {x: 1.2, y: 6, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 2835830911057077560}
|
m_Father: {fileID: 2835830911057077560}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
@ -107,6 +108,7 @@ RectTransform:
|
|||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 5, z: 1}
|
m_LocalScale: {x: 1, y: 5, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 2835830911057077560}
|
m_Father: {fileID: 2835830911057077560}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
@ -186,6 +188,7 @@ RectTransform:
|
|||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0.95, y: 0.2, z: 1}
|
m_LocalScale: {x: 0.95, y: 0.2, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 2835830909972040045}
|
- {fileID: 2835830909972040045}
|
||||||
- {fileID: 2835830910843601522}
|
- {fileID: 2835830910843601522}
|
||||||
|
@ -786,7 +786,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -794,15 +794,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -846,11 +846,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 477.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -72.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -924,7 +924,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -932,15 +932,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -984,11 +984,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 277.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -72.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1062,7 +1062,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1070,15 +1070,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1122,11 +1122,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 77.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -72.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1200,7 +1200,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1208,15 +1208,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1260,11 +1260,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 377.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -72.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1338,7 +1338,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1346,15 +1346,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1398,11 +1398,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 177.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -72.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1476,7 +1476,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1484,15 +1484,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1536,11 +1536,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 77.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -227.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1614,7 +1614,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1622,15 +1622,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1674,11 +1674,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 77.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -457.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1752,7 +1752,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1760,15 +1760,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1812,11 +1812,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 77.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -342.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
@ -1882,7 +1882,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -1890,15 +1890,15 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
@ -1942,11 +1942,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 77.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -112.5
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
- target: {fileID: 6050866944478881893, guid: 27d62cf80d88f774abdf05e1c1663f1c, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
8
Assets/Resources/UiPanels/Shop.meta
Normal file
8
Assets/Resources/UiPanels/Shop.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 298e71b7ba16d154cb08695f420aee2f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
357
Assets/Resources/UiPanels/Shop/ChestSlot.prefab
Normal file
357
Assets/Resources/UiPanels/Shop/ChestSlot.prefab
Normal file
@ -0,0 +1,357 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &3818338909570481462
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 3818338909570481463}
|
||||||
|
- component: {fileID: 3818338909570481461}
|
||||||
|
- component: {fileID: 3818338909570481460}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: number_held
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &3818338909570481463
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338909570481462}
|
||||||
|
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: 3818338910890019851}
|
||||||
|
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: 16.7, y: -20.2}
|
||||||
|
m_SizeDelta: {x: 30, y: 15.3012}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &3818338909570481461
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338909570481462}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &3818338909570481460
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338909570481462}
|
||||||
|
m_Enabled: 0
|
||||||
|
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: '0
|
||||||
|
|
||||||
|
'
|
||||||
|
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: 16
|
||||||
|
m_fontSizeBase: 16
|
||||||
|
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 &3818338910890019850
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 3818338910890019851}
|
||||||
|
- component: {fileID: 3818338910890019849}
|
||||||
|
- component: {fileID: 3818338910890019848}
|
||||||
|
- component: {fileID: 7379342322136183382}
|
||||||
|
- component: {fileID: 6370833506293926211}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: ChestSlot
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &3818338910890019851
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338910890019850}
|
||||||
|
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: 3818338911641453617}
|
||||||
|
- {fileID: 3818338909570481463}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
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: 55, y: -55}
|
||||||
|
m_SizeDelta: {x: 60, y: 60}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &3818338910890019849
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338910890019850}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &3818338910890019848
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338910890019850}
|
||||||
|
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: a45fb5c08be526a4dabe2e91e53f4d15, 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!114 &7379342322136183382
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338910890019850}
|
||||||
|
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: 3818338910890019848}
|
||||||
|
m_OnClick:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
--- !u!114 &6370833506293926211
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338910890019850}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 6bf41236973acd14caf4428b908d0674, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
slotItemNumberText: {fileID: 3818338909570481460}
|
||||||
|
itemImage: {fileID: 3818338911641453630}
|
||||||
|
_PanelController: {fileID: 0}
|
||||||
|
_number: 0
|
||||||
|
_item: {fileID: 0}
|
||||||
|
countStackableItems: 0
|
||||||
|
--- !u!1 &3818338911641453616
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 3818338911641453617}
|
||||||
|
- component: {fileID: 3818338911641453631}
|
||||||
|
- component: {fileID: 3818338911641453630}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: inventory_image
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &3818338911641453617
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338911641453616}
|
||||||
|
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: 3818338910890019851}
|
||||||
|
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: 50, y: 50}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &3818338911641453631
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338911641453616}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &3818338911641453630
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3818338911641453616}
|
||||||
|
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: 0}
|
||||||
|
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: 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
|
7
Assets/Resources/UiPanels/Shop/ChestSlot.prefab.meta
Normal file
7
Assets/Resources/UiPanels/Shop/ChestSlot.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9a433c7b5b00f9b4489a10db4051c7b7
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
1830
Assets/Resources/UiPanels/Shop/ShopPanel.prefab
Normal file
1830
Assets/Resources/UiPanels/Shop/ShopPanel.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Resources/UiPanels/Shop/ShopPanel.prefab.meta
Normal file
7
Assets/Resources/UiPanels/Shop/ShopPanel.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a159d0aaa20a84d47bd3b412db2822e4
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -66,6 +66,7 @@ public class AnimatedDoorBehaviour : TriggerDoor
|
|||||||
SaveController.GetComponent<SaveController>().SaveHealth();
|
SaveController.GetComponent<SaveController>().SaveHealth();
|
||||||
|
|
||||||
SaveController.GetComponent<SaveController>().SaveChests();
|
SaveController.GetComponent<SaveController>().SaveChests();
|
||||||
|
SaveController.GetComponent<SaveController>().SaveShops();
|
||||||
|
|
||||||
// 2. Change scene
|
// 2. Change scene
|
||||||
SceneManager.LoadScene(gateway.nextMapName);
|
SceneManager.LoadScene(gateway.nextMapName);
|
||||||
|
@ -47,6 +47,8 @@ public class DoorBehaviour : MonoBehaviour
|
|||||||
SaveController.GetComponent<SaveController>().SaveHealth();
|
SaveController.GetComponent<SaveController>().SaveHealth();
|
||||||
|
|
||||||
SaveController.GetComponent<SaveController>().SaveChests();
|
SaveController.GetComponent<SaveController>().SaveChests();
|
||||||
|
SaveController.GetComponent<SaveController>().SaveShops();
|
||||||
|
|
||||||
// 2. Change scene
|
// 2. Change scene
|
||||||
SceneManager.LoadScene(gateway.nextMapName);
|
SceneManager.LoadScene(gateway.nextMapName);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ public class NPCFollowing : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (approaching && Vector2.Distance(targetPosition.position, transform.position) >= actionRadius)
|
if (approaching && Vector2.Distance(targetPosition.position, transform.position) >= actionRadius)
|
||||||
{
|
{
|
||||||
Debug.Log(agent);
|
|
||||||
agent.FindPath();
|
agent.FindPath();
|
||||||
//transform.position = Vector2.MoveTowards(transform.position, target.position, moveSpeed * Time.deltaTime);
|
//transform.position = Vector2.MoveTowards(transform.position, target.position, moveSpeed * Time.deltaTime);
|
||||||
StartCoroutine(agent.FollowPath());
|
StartCoroutine(agent.FollowPath());
|
||||||
|
@ -24,11 +24,6 @@ public class ChestController : MonoBehaviour
|
|||||||
ChestUIManager.Instance.CurrentChestName = null;
|
ChestUIManager.Instance.CurrentChestName = null;
|
||||||
|
|
||||||
ChestUIManager.Instance.ClosePanel();
|
ChestUIManager.Instance.ClosePanel();
|
||||||
|
|
||||||
// Close additiona panels
|
|
||||||
if (EquipmentUIManager.Instance.GetPanelStatus()) EquipmentUIManager.Instance.ClosePanel();
|
|
||||||
|
|
||||||
if (InventoryUIManager.Instance.GetPanelStatus()) InventoryUIManager.Instance.ClosePanel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,11 @@ public class NPC : MonoBehaviour
|
|||||||
|
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
|
public NPCStateEnum State = NPCStateEnum.Pending;
|
||||||
|
|
||||||
|
|
||||||
|
public void ChangeState(NPCStateEnum _newState)
|
||||||
|
{
|
||||||
|
State = _newState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
98
Assets/Scripts/REFACTORING/Application/NPC/NpcShopManager.cs
Normal file
98
Assets/Scripts/REFACTORING/Application/NPC/NpcShopManager.cs
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
class NpcShopManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
public Dialogue DialogueTemplate;
|
||||||
|
|
||||||
|
/* We user object CLONED TO PREVENT overwritting changes in main object inassets */
|
||||||
|
private Dialogue Dialogue;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public Shop shop;
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
// TODO - remove - we want ot register ir manually because condition below is not meeted in test env
|
||||||
|
this.RegisterShop();
|
||||||
|
|
||||||
|
|
||||||
|
// 1. Create dialogue object from template
|
||||||
|
|
||||||
|
// 2. Set speaker name
|
||||||
|
Dialogue = Instantiate(DialogueTemplate);
|
||||||
|
Dialogue.SetSpeakerName(gameObject.GetComponent<NPC>().name);
|
||||||
|
|
||||||
|
// if its new game or we dont have any save from this map - use deffault shop settings / content
|
||||||
|
// else overwrite value by saved one
|
||||||
|
if (OnMapAppearanceMethod.GameStatus == GameStatus.NewGame ||
|
||||||
|
(OnMapAppearanceMethod.Gateway != OnMapAppearanceMethodEnum.NewGame || ShopUIManager.Instance.GetList().Count == 0)
|
||||||
|
)
|
||||||
|
// 0. Register shop in scene shop manager
|
||||||
|
this.RegisterShop();
|
||||||
|
//ShopUIManager.Instance.Add(shop);
|
||||||
|
else
|
||||||
|
shop = ShopUIManager.Instance.GetList().Where(shop => {
|
||||||
|
return shop.Npc == gameObject.GetComponent<NPC>().name && shop.Map == SceneManager.GetActiveScene().name;
|
||||||
|
}).First();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnTriggerEnter2D(Collider2D collision)
|
||||||
|
{
|
||||||
|
if(collision.gameObject.tag == "Player" && gameObject.GetComponent<NPC>().State == NPCStateEnum.Trading && !ShopUIManager.Instance.GetPanelStatus())
|
||||||
|
{
|
||||||
|
// 1. Open dialogue panel
|
||||||
|
|
||||||
|
// 2. Open shop
|
||||||
|
|
||||||
|
OpenShop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnTriggerExit2D(Collider2D collision)
|
||||||
|
{
|
||||||
|
if (collision.gameObject.tag == "Player")
|
||||||
|
{
|
||||||
|
CloseShop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterShop()
|
||||||
|
{
|
||||||
|
// 1. Set owner name
|
||||||
|
shop.Npc = gameObject.name;
|
||||||
|
|
||||||
|
// 2. Create new Shop instance in scene registry list
|
||||||
|
((SceneShopDataManager)SceneShopDataManager.Instance)
|
||||||
|
.RegisterShop(
|
||||||
|
new Shop(
|
||||||
|
SceneManager.GetActiveScene().name,
|
||||||
|
gameObject.name,
|
||||||
|
shop.GetContent()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenShop()
|
||||||
|
{
|
||||||
|
Debug.Log("OpenShop");
|
||||||
|
|
||||||
|
// Open shopa action - invoked as dialogue end action
|
||||||
|
ShopUIManager.Instance.CurrentShopOwnerName = gameObject.GetComponent<NPC>().name;
|
||||||
|
ShopUIManager.Instance.OpenPanel();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CloseShop()
|
||||||
|
{
|
||||||
|
ShopUIManager.Instance.ClosePanel();
|
||||||
|
|
||||||
|
ShopUIManager.Instance.CurrentShopOwnerName = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 965172500144077489774a33c2fa0660
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Scripts/REFACTORING/Application/Panel/Shop.meta
Normal file
8
Assets/Scripts/REFACTORING/Application/Panel/Shop.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8c41b592443b53b45b36340468fcd02e
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,100 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization.Formatters.Binary;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class SaveShopManager : SaveModelSystem<Shop>
|
||||||
|
{
|
||||||
|
public override bool SaveModelItem(Shop model)
|
||||||
|
{
|
||||||
|
return base.SaveModelItem(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool SaveModelList(List<Shop> list)
|
||||||
|
{
|
||||||
|
BinaryFormatter formatter = new BinaryFormatter();
|
||||||
|
|
||||||
|
Debug.Log("Saved Shops at " + Path);
|
||||||
|
|
||||||
|
if (!Directory.Exists(Path)) Directory.CreateDirectory(Path);
|
||||||
|
|
||||||
|
/* Main logic of conversion data format */
|
||||||
|
var data = ConvertObjectsListToListOfDataModels(list);
|
||||||
|
|
||||||
|
FileStream stream = new FileStream(
|
||||||
|
Path + GetFileName(ObjectListName),
|
||||||
|
FileMode.Create
|
||||||
|
);
|
||||||
|
|
||||||
|
formatter.Serialize(stream, data);
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Shop LoadModelItem()
|
||||||
|
{
|
||||||
|
return base.LoadModelItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override List<Shop> LoadModelList()
|
||||||
|
{
|
||||||
|
string path = Path + GetFileName(ObjectListName);
|
||||||
|
|
||||||
|
if (File.Exists(path))
|
||||||
|
{
|
||||||
|
BinaryFormatter formatter = new BinaryFormatter();
|
||||||
|
FileStream stream = new FileStream(path, FileMode.Open);
|
||||||
|
|
||||||
|
List<ShopData> questsList = formatter.Deserialize(stream) as List<ShopData>;
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
|
return ConvertListOfDataModelsToListOfObject(questsList);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log("Save file not found in " + path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new List<Shop>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Support function
|
||||||
|
|
||||||
|
// 1. From model to data format
|
||||||
|
public static ShopData ConvertObjectToDataModel(Shop model)
|
||||||
|
{
|
||||||
|
return new ShopData(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ShopData> ConvertObjectsListToListOfDataModels(List<Shop> modelsList)
|
||||||
|
{
|
||||||
|
List<ShopData> convertedList = new List<ShopData>();
|
||||||
|
|
||||||
|
foreach (Shop model in modelsList)
|
||||||
|
{
|
||||||
|
convertedList.Add(ConvertObjectToDataModel(model));
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertedList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. From data to model format
|
||||||
|
public static Shop ConvertDataModelToObject(ShopData dataModel)
|
||||||
|
{
|
||||||
|
return (Shop)dataModel.MapDataToObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Shop> ConvertListOfDataModelsToListOfObject(List<ShopData> dataModelsList)
|
||||||
|
{
|
||||||
|
List<Shop> convertedList = new List<Shop>();
|
||||||
|
|
||||||
|
foreach (ShopData dataModel in dataModelsList)
|
||||||
|
{
|
||||||
|
convertedList.Add(ConvertDataModelToObject(dataModel));
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertedList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fb95e6324ffd5c3438985ff99f6ac077
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,108 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class SceneShopDataLoader : SceneBaseDataLoader<Shop>
|
||||||
|
{
|
||||||
|
public SceneShopDataLoader(string _objectListName, string _objectFolderName)
|
||||||
|
{
|
||||||
|
SaveModelSystem = new SaveShopManager();
|
||||||
|
SaveModelSystem.ObjectFolderName = _objectFolderName;
|
||||||
|
SaveModelSystem.ObjectListName = _objectListName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public void LoadInventoryItemsList()
|
||||||
|
{
|
||||||
|
string path = SaveSystem.GetSavePath();
|
||||||
|
|
||||||
|
if (!Directory.Exists(path)) // if not exists thats mean there was nothing saved yet - nothing to load
|
||||||
|
return;
|
||||||
|
|
||||||
|
FileInfo[] fileInfo = new DirectoryInfo(path).GetFiles();
|
||||||
|
|
||||||
|
foreach(FileInfo file in fileInfo)
|
||||||
|
{
|
||||||
|
if(file.Name != this.ItemsListName + ".fun")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Dictionary<int, EquippableItemPrefabAssetData> equippableItemsList = SaveInventorySystem.LoadInventoryItemsList(this.ItemsListName);
|
||||||
|
|
||||||
|
// itemEntry.Value.MapDataToObject() - map data format to object
|
||||||
|
|
||||||
|
// save object
|
||||||
|
foreach(KeyValuePair<int, EquippableItemPrefabAssetData> itemEntry in equippableItemsList)
|
||||||
|
{
|
||||||
|
InventoryManager.Instance.SetupItemInInventory(itemEntry.Key, itemEntry.Value.MapDataToEquippableItemPrefarbAsset().equippableItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveInventoryItems()
|
||||||
|
{
|
||||||
|
// Case I - if we remember all list
|
||||||
|
// 1) if after removed item form DynamicList is empty - remove all file
|
||||||
|
// 2) if after removed item form DynamciList there are another one - save updated list again
|
||||||
|
if(InventoryManager.Instance._items.Count > 0) {
|
||||||
|
|
||||||
|
// 1. Map From Dictionary<int, Item>' to 'Dictionary<int, EquippableItemPrefabAsset>'
|
||||||
|
Dictionary<int, EquippableItemPrefabAsset> mappedList = new Dictionary<int, EquippableItemPrefabAsset>();
|
||||||
|
|
||||||
|
foreach(KeyValuePair<int, Item> itemElement in InventoryManager.Instance._items)
|
||||||
|
{
|
||||||
|
mappedList[itemElement.Key] = new EquippableItemPrefabAsset(
|
||||||
|
itemElement.Value.Name,
|
||||||
|
itemElement.Value.ItemModel.name,
|
||||||
|
new Vector3(0,0,0),
|
||||||
|
(EquippableItem) itemElement.Value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Save Items
|
||||||
|
SaveInventorySystem.SaveInventoryItemsList(mappedList, this.ItemsListName);
|
||||||
|
} else {
|
||||||
|
string _path = SaveSystem.GetSavePath() + "/" + this.ItemsListName + ".fun";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Log("File to remove: " + _path);
|
||||||
|
|
||||||
|
if(File.Exists(_path))
|
||||||
|
{
|
||||||
|
File.Delete(_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ioExp)
|
||||||
|
{
|
||||||
|
Debug.LogError(ioExp.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Case II - if we rememenber object per file
|
||||||
|
// 1) remove specyfic file
|
||||||
|
//
|
||||||
|
// Unfortunatelly we don't use this way of saving items yet :D
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
protected override List<Shop> LoadDynamicData()
|
||||||
|
{
|
||||||
|
SaveModelSystem.Path = PathBuilder.BuildSavePath().WithMap(CurrentMap).WithDataType(SceneElementTypeEnum.Dynamic).GetString();
|
||||||
|
|
||||||
|
return SaveModelSystem.LoadModelList();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool SaveDynamicData(List<Shop> _elements)
|
||||||
|
{
|
||||||
|
SaveModelSystem.Path = PathBuilder.BuildSavePath().WithMap(CurrentMap).WithDataType(SceneElementTypeEnum.Dynamic).GetString();
|
||||||
|
|
||||||
|
return base.SaveDynamicData(_elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override List<Shop> LoadGenericData() { throw new NotImplementedException(); }
|
||||||
|
|
||||||
|
protected override bool SaveGenericData(List<Shop> _elements) { throw new NotImplementedException(); }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 46738cb8cf9b480eb99dce24e8d1e80e
|
||||||
|
timeCreated: 1670938286
|
@ -0,0 +1,154 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class SceneShopDataManager : SceneBaseDataManager<Shop>
|
||||||
|
{
|
||||||
|
protected override string OBJECT_FOLDER_NAME { get { return "Shop"; } }
|
||||||
|
protected override string OBJECT_LIST_NAME { get { return "ShopList"; } }
|
||||||
|
|
||||||
|
[SerializeField] protected new ShopUIManager UiManager;
|
||||||
|
|
||||||
|
// Instead of build elements on scene we collect shops distracted on scene from npc's
|
||||||
|
//[SerializeField] List<Shop> ElementsToBuildOnSceneList = new List<Shop>();
|
||||||
|
|
||||||
|
|
||||||
|
public override void Awake()
|
||||||
|
{
|
||||||
|
if (Instance == null)
|
||||||
|
{
|
||||||
|
|
||||||
|
Instance = this;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Start()
|
||||||
|
{
|
||||||
|
Debug.Log("Start SceneChestData manager");
|
||||||
|
|
||||||
|
//TaskUIManager.FindOrCreateInstance();
|
||||||
|
UiManager = ShopUIManager.Instance;
|
||||||
|
|
||||||
|
if (UiManager == null)
|
||||||
|
throw new NullReferenceException("ChestUIManager not found!!!");
|
||||||
|
|
||||||
|
DynamicDataList = (new ShopDataListManager()).SetUiManager(ref UiManager);
|
||||||
|
|
||||||
|
DataLoader = new SceneShopDataLoader(OBJECT_LIST_NAME, OBJECT_FOLDER_NAME);
|
||||||
|
|
||||||
|
base.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO - save ChestPrefabAsset (we need to save coords...) but in manager handle Chest data..
|
||||||
|
//
|
||||||
|
protected override void AfterStart()
|
||||||
|
{
|
||||||
|
if(OnMapAppearanceMethod.GameStatus == GameStatus.NewGame)
|
||||||
|
{
|
||||||
|
if (OnMapAppearanceMethod.Gateway != OnMapAppearanceMethodEnum.NewGame)
|
||||||
|
UseDynamicSettings(); // if there is nothing saved we will use UseDefaultSettings
|
||||||
|
else
|
||||||
|
UseDefaultSettings();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
Debug.Log("UseDynamicSettings");
|
||||||
|
UseDynamicSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected SceneBaseDataManager<ChestPrefabAsset> GetObjectType()
|
||||||
|
{
|
||||||
|
return GameObject.FindObjectOfType<SceneChestDataManager>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected SceneBaseDataManager<ChestPrefabAsset> CreateInstance(ref GameObject managerGameObject)
|
||||||
|
{
|
||||||
|
return managerGameObject.AddComponent<SceneChestDataManager>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected override void UseDefaultSettings()
|
||||||
|
{
|
||||||
|
Debug.Log("UseDefaultSettings");
|
||||||
|
|
||||||
|
// we dont need to convert anything
|
||||||
|
// Instead of build elements on scene we collect shops distracted on scene from npc's
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void UseDynamicSettings()
|
||||||
|
{
|
||||||
|
Debug.Log("UseDynamicSettings");
|
||||||
|
|
||||||
|
// BuildList();
|
||||||
|
|
||||||
|
// when chest detect player in near arrea and player press "c"
|
||||||
|
// open panel -> chest controller handle Open panel in Scene Chest Manager passing info about what Chest Palyer want to open
|
||||||
|
// Manager Build panel and pass info about chest content
|
||||||
|
|
||||||
|
LoadDynamicData();
|
||||||
|
|
||||||
|
|
||||||
|
// VERy VERY provisional SOLUTION
|
||||||
|
if (DynamicDataList.GetList().Count == 0)
|
||||||
|
{
|
||||||
|
UseDefaultSettings();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UiManager.SetList(DynamicDataList.GetList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO SHOP API
|
||||||
|
public void RegisterShop(Shop newShop)
|
||||||
|
{
|
||||||
|
if (DynamicDataList.GetList().Where(shop => shop.Npc == newShop.Npc && shop.Map == SceneManager.GetActiveScene().name).Any())
|
||||||
|
Debug.LogError("In Shop Manager there is register this shop already");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DynamicDataList.AddElementToList(newShop);
|
||||||
|
|
||||||
|
UiManager.SetList(DynamicDataList.GetList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO manager api
|
||||||
|
// open panel extend function
|
||||||
|
// close panel extend function
|
||||||
|
|
||||||
|
|
||||||
|
// TODO chest api
|
||||||
|
// add to chest - find chest by its name np
|
||||||
|
// remove from chest - select chest by its name -
|
||||||
|
// chesk item in chest - check chest by tis name
|
||||||
|
|
||||||
|
|
||||||
|
public override bool SaveDynamicData()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
// how to get list
|
||||||
|
// 1. List in UI manager should be synchronized with list in this manager
|
||||||
|
|
||||||
|
foreach (Shop shop in UiManager.GetList())
|
||||||
|
{
|
||||||
|
DynamicDataList.GetList().Where(el => el.Map == shop.Map && el.Npc == shop.Npc).ToList().ForEach(el => el = shop);
|
||||||
|
}
|
||||||
|
|
||||||
|
//DynamicDataList.SetList(tmp);
|
||||||
|
|
||||||
|
// approach:
|
||||||
|
// 1. get from outside, update local list && us it
|
||||||
|
// 2. Handle list synchronized all the time & pass local list
|
||||||
|
return SaveData(DynamicDataList.GetList(), SceneElementTypeEnum.Dynamic);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 40e9faa037584ea2bfba8168125f3fde
|
||||||
|
timeCreated: 1670937942
|
@ -0,0 +1,31 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class ShopDataListManager : DataListManager<Shop> // or maybe EquippableItem - but its get conflicts...
|
||||||
|
{
|
||||||
|
[SerializeField] protected new ShopUIManager uiManager;
|
||||||
|
|
||||||
|
public new DataListManager<Shop> SetUiManager(ref ShopUIManager _uiManager)
|
||||||
|
{
|
||||||
|
uiManager = _uiManager;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add shop to list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newElement"></param>
|
||||||
|
public override void AddElementToList(Shop newElement)
|
||||||
|
{
|
||||||
|
Elements.Add(newElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RemoveElementFromList(Shop element)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
//public void AddElement
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: df6947d3e5006b242a8d0f4d9e352aac
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -73,8 +73,6 @@ public abstract class SceneBaseDataLoader<T> : SceneDataLoaderInterface<T>
|
|||||||
|
|
||||||
protected virtual bool SaveDynamicData(List<T> _elements)
|
protected virtual bool SaveDynamicData(List<T> _elements)
|
||||||
{
|
{
|
||||||
Debug.Log(SaveModelSystem.Path);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SaveModelSystem.SaveModelList(_elements);
|
SaveModelSystem.SaveModelList(_elements);
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public abstract class DraggablePanelController : PanelController<IndexValuePair<int, EquippableItem>>, DraggablePanelInterface
|
public abstract class DraggablePanelController : PanelController<IndexValuePair<int, EquippableItem>>, DraggablePanelInterface
|
||||||
{
|
{
|
||||||
|
public bool AllowToUseItemInPanel = true;
|
||||||
|
|
||||||
[SerializeField] protected new List<ISlot> ChildBoxList = new List<ISlot>();
|
[SerializeField] protected new List<ISlot> ChildBoxList = new List<ISlot>();
|
||||||
|
|
||||||
protected static UIWarehouseManager _uiManager;
|
protected static UIWarehouseManager _uiManager;
|
||||||
@ -27,11 +30,13 @@ public abstract class DraggablePanelController : PanelController<IndexValuePair<
|
|||||||
slot.OnEndDragEvent += EndDrag;
|
slot.OnEndDragEvent += EndDrag;
|
||||||
slot.OnDragEvent += Drag;
|
slot.OnDragEvent += Drag;
|
||||||
slot.OnDropEvent += Drop;
|
slot.OnDropEvent += Drop;
|
||||||
|
slot.OnPointerClickEvent += MouseClick;
|
||||||
|
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeginDrag(ItemSlot itemSlot)
|
#region drag & drop handler
|
||||||
|
public virtual void BeginDrag(ItemSlot itemSlot)
|
||||||
{
|
{
|
||||||
if (itemSlot.Item != null)
|
if (itemSlot.Item != null)
|
||||||
{
|
{
|
||||||
@ -39,7 +44,7 @@ public abstract class DraggablePanelController : PanelController<IndexValuePair<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Drag(ItemSlot itemSlot)
|
public virtual void Drag(ItemSlot itemSlot)
|
||||||
{
|
{
|
||||||
DraggedSlotController.Instance.UpdatePosition(Input.mousePosition);
|
DraggedSlotController.Instance.UpdatePosition(Input.mousePosition);
|
||||||
}
|
}
|
||||||
@ -91,6 +96,51 @@ public abstract class DraggablePanelController : PanelController<IndexValuePair<
|
|||||||
DraggedSlotController.Instance.UpdateItem(null);
|
DraggedSlotController.Instance.UpdateItem(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void MouseClick(ItemSlot itemSlot, PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (eventData.button == PointerEventData.InputButton.Right && eventData.clickCount == 1)
|
||||||
|
{
|
||||||
|
SingleRightMouseClick(itemSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eventData.button == PointerEventData.InputButton.Right && eventData.clickCount == 2)
|
||||||
|
{
|
||||||
|
DoubleRightMouseClick(itemSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eventData.button == PointerEventData.InputButton.Left && eventData.clickCount == 1)
|
||||||
|
{
|
||||||
|
SingleLeftMouseClick(itemSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eventData.button == PointerEventData.InputButton.Left && eventData.clickCount == 2)
|
||||||
|
{
|
||||||
|
DoubleLeftMouseClick(itemSlot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region mouse handler
|
||||||
|
public virtual void SingleRightMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void DoubleRightMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public virtual void SingleLeftMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public virtual void DoubleLeftMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public ISlot GetDraggedSlot()
|
public ISlot GetDraggedSlot()
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
public interface DraggablePanelInterface
|
public interface DraggablePanelInterface
|
||||||
{
|
{
|
||||||
@ -18,6 +19,8 @@ public interface DraggablePanelInterface
|
|||||||
|
|
||||||
public void Drop(ItemSlot dropItemSlot);
|
public void Drop(ItemSlot dropItemSlot);
|
||||||
|
|
||||||
|
public void MouseClick(ItemSlot itemSlot, PointerEventData eventData);
|
||||||
|
|
||||||
// supports function to use in Drop
|
// supports function to use in Drop
|
||||||
public ISlot GetDraggedSlot();
|
public ISlot GetDraggedSlot();
|
||||||
}
|
}
|
@ -22,12 +22,32 @@ public abstract class WarehousePanelController : DraggablePanelController
|
|||||||
|
|
||||||
// 2. Rebuild/apply UiManager content (list of items) base on slots values after its updating
|
// 2. Rebuild/apply UiManager content (list of items) base on slots values after its updating
|
||||||
|
|
||||||
|
// 2.1 Make copy because Add -> base.Add() -> base.Add() -> UpdateList() rebuild content ad pass "new" list (in this case with only one - firtst passed - item) to ChestContentUiMangaer.Element
|
||||||
|
UpdatePanelContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DoubleLeftMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
if(AllowToUseItemInPanel)
|
||||||
|
itemSlot.Item?.InvokeEffectAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override void BuildPanelContent(List<IndexValuePair<int, EquippableItem>> elements)
|
||||||
|
{
|
||||||
|
base.BuildPanelContent(elements);
|
||||||
|
|
||||||
|
ClearSlots();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePanelContent()
|
||||||
|
{
|
||||||
// 2.1 Make copy because Add -> base.Add() -> base.Add() -> UpdateList() rebuild content ad pass "new" list (in this case with only one - firtst passed - item) to ChestContentUiMangaer.Element
|
// 2.1 Make copy because Add -> base.Add() -> base.Add() -> UpdateList() rebuild content ad pass "new" list (in this case with only one - firtst passed - item) to ChestContentUiMangaer.Element
|
||||||
var ChildBoxListCopy = new List<IndexValuePair<int, EquippableItem>>(ChildBoxList.Where(slot => slot.Item != null).Select(slot => new IndexValuePair<int, EquippableItem>(slot.Number, slot.Item)).ToList());
|
var ChildBoxListCopy = new List<IndexValuePair<int, EquippableItem>>(ChildBoxList.Where(slot => slot.Item != null).Select(slot => new IndexValuePair<int, EquippableItem>(slot.Number, slot.Item)).ToList());
|
||||||
|
|
||||||
UiManager.RemoveAll();
|
UiManager.RemoveAll();
|
||||||
|
|
||||||
foreach(IndexValuePair<int, EquippableItem> slot in ChildBoxListCopy)
|
foreach (IndexValuePair<int, EquippableItem> slot in ChildBoxListCopy)
|
||||||
{
|
{
|
||||||
if (slot.Value != null)
|
if (slot.Value != null)
|
||||||
{
|
{
|
||||||
@ -41,13 +61,6 @@ public abstract class WarehousePanelController : DraggablePanelController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void BuildPanelContent(List<IndexValuePair<int, EquippableItem>> elements)
|
|
||||||
{
|
|
||||||
base.BuildPanelContent(elements);
|
|
||||||
|
|
||||||
ClearSlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void ClearSlots()
|
public override void ClearSlots()
|
||||||
{
|
{
|
||||||
foreach (ItemSlot ChestSlot in ChildBoxList)
|
foreach (ItemSlot ChestSlot in ChildBoxList)
|
||||||
|
@ -71,6 +71,8 @@ public abstract class UIBaseManager<T> : MonoBehaviour, ManagerInterface<T>
|
|||||||
|
|
||||||
DynamicPanel.transform.localPosition = uiPanelTemplate.transform.position; // prevent overwritten position by... environment???
|
DynamicPanel.transform.localPosition = uiPanelTemplate.transform.position; // prevent overwritten position by... environment???
|
||||||
|
|
||||||
|
DynamicPanel.name = uiPanelTemplate.name;
|
||||||
|
|
||||||
SetupPanel();
|
SetupPanel();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ce25c90d4bfc30849b2f0c4d83a0c5cb
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
interface IModelMapper<T>
|
||||||
|
{
|
||||||
|
public abstract T MapDataToObject(string prefarbAssetName);
|
||||||
|
|
||||||
|
public abstract T MapDataToObject();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d6b77778b83103e4086ee2bd0e833032
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Scripts/REFACTORING/Application/Shop.meta
Normal file
8
Assets/Scripts/REFACTORING/Application/Shop.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 48fd614d22204de49ada0e5287d3f5ba
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,168 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public enum ShopItemCardMode
|
||||||
|
{
|
||||||
|
Buy,
|
||||||
|
Sell
|
||||||
|
}
|
||||||
|
|
||||||
|
class ShopItemCardKeeper : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Current Item")]
|
||||||
|
public EquippableItem SelectedItem;
|
||||||
|
public int OriginSlotNumver;
|
||||||
|
|
||||||
|
[Header("Shopping Card")]
|
||||||
|
[SerializeField] private Button _buyButton;
|
||||||
|
[SerializeField] private Button _sellButton;
|
||||||
|
|
||||||
|
|
||||||
|
[Header("Item Preveiw Section")]
|
||||||
|
[SerializeField] public ShopItemCardMode ShopMode;
|
||||||
|
[SerializeField] private TextMeshProUGUI _itemPreviewName;
|
||||||
|
[SerializeField] private TextMeshProUGUI _itemPreviewDescription;
|
||||||
|
[SerializeField] private TextMeshProUGUI _itemPreviewStats;
|
||||||
|
[SerializeField] private TextMeshProUGUI _itemPreviewStatsValue;
|
||||||
|
[SerializeField] private Text _itemPreviewPrice;
|
||||||
|
|
||||||
|
|
||||||
|
public void ShowItemDetails(ItemSlot itemSlot, ShopItemCardMode mode = ShopItemCardMode.Buy)
|
||||||
|
{
|
||||||
|
SelectedItem = itemSlot.Item;
|
||||||
|
OriginSlotNumver = itemSlot.Number;
|
||||||
|
|
||||||
|
ShopMode = mode;
|
||||||
|
|
||||||
|
gameObject.active = true;
|
||||||
|
|
||||||
|
BildCardContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void BildCardContent()
|
||||||
|
{
|
||||||
|
// Clear poanel
|
||||||
|
if (!SelectedItem)
|
||||||
|
{
|
||||||
|
_itemPreviewName.text = "";
|
||||||
|
_itemPreviewDescription.text = "";
|
||||||
|
_itemPreviewStats.text = "";
|
||||||
|
_itemPreviewStatsValue.text = "";
|
||||||
|
_itemPreviewPrice.text = "";
|
||||||
|
|
||||||
|
_buyButton.gameObject.SetActive(false);
|
||||||
|
_sellButton.gameObject.SetActive(false);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_itemPreviewName.text = SelectedItem.Name;
|
||||||
|
|
||||||
|
_itemPreviewDescription.text = SelectedItem.Description;
|
||||||
|
|
||||||
|
_itemPreviewStats.text = BuildItemStats();
|
||||||
|
_itemPreviewStatsValue.text = SelectedItem.Value.ToString();
|
||||||
|
|
||||||
|
_itemPreviewPrice.text = $"Price: {CountPrice()}";
|
||||||
|
|
||||||
|
switch(ShopMode)
|
||||||
|
{
|
||||||
|
case ShopItemCardMode.Buy:
|
||||||
|
{
|
||||||
|
_sellButton.gameObject.SetActive(false);
|
||||||
|
|
||||||
|
_buyButton.gameObject.SetActive(true);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ShopItemCardMode.Sell:
|
||||||
|
{
|
||||||
|
_buyButton.gameObject.SetActive(false);
|
||||||
|
|
||||||
|
_sellButton.gameObject.SetActive(true);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string BuildItemStats()
|
||||||
|
{
|
||||||
|
if(SelectedItem.EquipmentType == EquipmentTypeEnum.Weapon)
|
||||||
|
return $"Attack: \n";
|
||||||
|
|
||||||
|
if (SelectedItem.EquipmentType == EquipmentTypeEnum.Helmet || SelectedItem.EquipmentType == EquipmentTypeEnum.Chest)
|
||||||
|
return $"Deffence: \n";
|
||||||
|
|
||||||
|
if (SelectedItem.EquipmentType == EquipmentTypeEnum.Boots)
|
||||||
|
return $"Speed: \n";
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CountPrice()
|
||||||
|
{
|
||||||
|
return SelectedItem.Price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void BuyItem()
|
||||||
|
{
|
||||||
|
Debug.Log("Buy item");
|
||||||
|
|
||||||
|
if (!_buyButton.IsActive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO - CHECK PLAYER ACCOUNT
|
||||||
|
|
||||||
|
// 1. Buy transaction
|
||||||
|
// 1.1.1 Add to player Inventory Panel + refresh view
|
||||||
|
InventoryUIManager.Instance.Add(SelectedItem);
|
||||||
|
|
||||||
|
if (InventoryUIManager.Instance.GetPanelStatus())
|
||||||
|
GameObject.FindObjectOfType<InventoryPanelController>().BuildPanelContent(InventoryUIManager.Instance.GetList());
|
||||||
|
|
||||||
|
// 1.1.2 Save chnages in Inventory Panel
|
||||||
|
SceneInventoryDataManager.Instance.SaveDynamicData();
|
||||||
|
|
||||||
|
// 1.2.1 Remove item from Shop Panel
|
||||||
|
ShopContentUIManager.Instance.RemoveByPosition(OriginSlotNumver);
|
||||||
|
|
||||||
|
if (ShopUIManager.Instance.GetPanelStatus())
|
||||||
|
GameObject.FindObjectOfType<ShopPanelController>().BuildPanelContent(ShopContentUIManager.Instance.GetList());
|
||||||
|
|
||||||
|
// 1.2.2 Save chnages in Shop Panel
|
||||||
|
SceneInventoryDataManager.Instance.SaveDynamicData();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 2. TODO - Player gold change & save
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SellItem()
|
||||||
|
{
|
||||||
|
Debug.Log("Sell item");
|
||||||
|
|
||||||
|
if (!_sellButton.IsActive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 1. Sell transaction
|
||||||
|
// 1.1.1 Remove from player Inventory Panel by position + refresh view
|
||||||
|
InventoryUIManager.Instance.RemoveByPosition(OriginSlotNumver);
|
||||||
|
|
||||||
|
if (InventoryUIManager.Instance.GetPanelStatus())
|
||||||
|
GameObject.FindObjectOfType<InventoryPanelController>().BuildPanelContent(InventoryUIManager.Instance.GetList());
|
||||||
|
|
||||||
|
// 1.1.2 Save chnages in Inventory Panel
|
||||||
|
SceneInventoryDataManager.Instance.SaveDynamicData();
|
||||||
|
|
||||||
|
|
||||||
|
// 2. TODO - Player gold change & save
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9e2866969bce0b54dbc4690d51aa19aa
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -49,6 +49,12 @@ public class ChestUIManager : UIBaseManager<Chest>
|
|||||||
|
|
||||||
ChestContentUIManager.Instance.DynamicPanel = null;
|
ChestContentUIManager.Instance.DynamicPanel = null;
|
||||||
|
|
||||||
|
// Close additionals panels
|
||||||
|
if (EquipmentUIManager.Instance.GetPanelStatus()) EquipmentUIManager.Instance.ClosePanel();
|
||||||
|
|
||||||
|
if (InventoryUIManager.Instance.GetPanelStatus()) InventoryUIManager.Instance.ClosePanel();
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,23 @@ public class EquipmentUIManager : UIWarehouseManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool OpenPanel()
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* We dont want to be able to open Inventory Panel when shop is opened
|
||||||
|
*/
|
||||||
|
if (ShopUIManager.Instance.GetPanelStatus())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OpenPanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override void SetupPanel()
|
public override void SetupPanel()
|
||||||
{
|
{
|
||||||
base.SetupPanel();
|
base.SetupPanel();
|
||||||
|
@ -23,6 +23,10 @@ public class ChestPanelController : WarehousePanelController
|
|||||||
// - remove item from position
|
// - remove item from position
|
||||||
// - find item in warehouse
|
// - find item in warehouse
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
AllowToUseItemInPanel = false;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. Prepare empty panel
|
// 1. Prepare empty panel
|
||||||
public override void BuildPanelSlots()
|
public override void BuildPanelSlots()
|
||||||
|
@ -92,9 +92,7 @@ public class EquipmentPanelController : DraggablePanelController
|
|||||||
|
|
||||||
var ChildBoxListCopy = new List<IndexValuePair<int, EquippableItem>>(ChildBoxList.Where(slot => slot.Item != null).Select(slot => new IndexValuePair<int, EquippableItem>(slot.Number, slot.Item)).ToList());
|
var ChildBoxListCopy = new List<IndexValuePair<int, EquippableItem>>(ChildBoxList.Where(slot => slot.Item != null).Select(slot => new IndexValuePair<int, EquippableItem>(slot.Number, slot.Item)).ToList());
|
||||||
|
|
||||||
Debug.Log(ChildBoxListCopy.Count());
|
|
||||||
UiManager.RemoveAll();
|
UiManager.RemoveAll();
|
||||||
Debug.Log(ChildBoxListCopy.Count());
|
|
||||||
|
|
||||||
foreach (IndexValuePair<int, EquippableItem> slot in ChildBoxListCopy)
|
foreach (IndexValuePair<int, EquippableItem> slot in ChildBoxListCopy)
|
||||||
{
|
{
|
||||||
@ -105,7 +103,7 @@ public class EquipmentPanelController : DraggablePanelController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UiManager.Add(new IndexValuePair<int, EquippableItem>(slot.Key, null));
|
UiManager.Add(new IndexValuePair<int, EquippableItem>(slot.Key, null)); // ONLY DIFFERENCE BETWEEN UpdatePanelContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,11 @@ public class InventoryPanelController : WarehousePanelController
|
|||||||
ChildBoxList[element.Key].SetItem(element.Value);
|
ChildBoxList[element.Key].SetItem(element.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void SingleLeftMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
// mark item as selected in shop panel
|
||||||
|
if (ShopContentUIManager.Instance.DynamicPanel)
|
||||||
|
ShopContentUIManager.Instance.DynamicPanel.transform.Find("ItemDetails").GetComponent<ShopItemCardKeeper>().ShowItemDetails(itemSlot, ShopItemCardMode.Sell);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,117 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
public class ShopPanelController : WarehousePanelController
|
||||||
|
{
|
||||||
|
protected override UIBaseManager<IndexValuePair<int, EquippableItem>> FetchUiManager()
|
||||||
|
{
|
||||||
|
return GameObject.FindObjectOfType<ShopContentUIManager>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// build panel sunction
|
||||||
|
// - setup - main function to build panel on screen
|
||||||
|
// - setPanelISlots - build slots on panel dependiong on declared amount
|
||||||
|
// - setPanelItems - invoking building items on slots
|
||||||
|
|
||||||
|
// api for drag and drop
|
||||||
|
// - set item on position
|
||||||
|
// - remove item from position
|
||||||
|
// - find item in warehouse
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
AllowToUseItemInPanel = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. Prepare empty panel
|
||||||
|
public override void BuildPanelSlots()
|
||||||
|
{
|
||||||
|
if (_panelContent == null)
|
||||||
|
throw new Exception("Panel content is not attaches");
|
||||||
|
|
||||||
|
for (int _position = 0; _position < UiManager.SLOTS_NUMBER; _position++)
|
||||||
|
{
|
||||||
|
//ISlot newSlot = SetupSlot(_position, _panel);
|
||||||
|
GameObject newSlot = BuildSlot(_position, _panelContent);
|
||||||
|
|
||||||
|
// Set new Slot instance
|
||||||
|
ChildBoxList.Add(newSlot.GetComponent<ShopSlot>());
|
||||||
|
|
||||||
|
// Assign events
|
||||||
|
ChildBoxList[_position] = SetupDragAndDropToSlot(ChildBoxList[_position]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override GameObject BuildSlot(int key, GameObject _parent)
|
||||||
|
{
|
||||||
|
if (ChildBoxTemplate == null)
|
||||||
|
throw new Exception("chestslotbox_template is empty");
|
||||||
|
|
||||||
|
GameObject _newItemSlot = MonoBehaviour.Instantiate(ChildBoxTemplate, _parent.transform.position, Quaternion.identity); //.GetComponent<InventorySlot>();
|
||||||
|
|
||||||
|
_newItemSlot.transform.SetParent(_parent.transform);
|
||||||
|
_newItemSlot.transform.localScale = new Vector3(1.15f, 1.15f, 1.15f);
|
||||||
|
|
||||||
|
_newItemSlot.GetComponent<ShopSlot>().SetupSlot(key, null, this);
|
||||||
|
|
||||||
|
return _newItemSlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. Set up panel additn items to it
|
||||||
|
public override void SetUp(List<IndexValuePair<int, EquippableItem>> elements)
|
||||||
|
{
|
||||||
|
// Build panel content template
|
||||||
|
BuildPanelSlots();
|
||||||
|
|
||||||
|
// Fill with items
|
||||||
|
BuildPanelContent(elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override void BuildPanelContent(List<IndexValuePair<int, EquippableItem>> elements)
|
||||||
|
{
|
||||||
|
|
||||||
|
base.BuildPanelContent(elements);
|
||||||
|
|
||||||
|
foreach (IndexValuePair<int, EquippableItem> element in elements)
|
||||||
|
{
|
||||||
|
Debug.Log($"key: {element.Key} - value: {element.Value}");
|
||||||
|
ChildBoxList[element.Key].SetItem(new EquippableItem(element.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//clear deffault efects
|
||||||
|
public override void BeginDrag(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Drag(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndDrag(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Drop(ItemSlot dropItemSlot)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public override void SingleLeftMouseClick(ItemSlot itemSlot)
|
||||||
|
{
|
||||||
|
// set item as selected
|
||||||
|
if (ShopContentUIManager.Instance.DynamicPanel)
|
||||||
|
ShopContentUIManager.Instance.DynamicPanel.transform.Find("ItemDetails").GetComponent<ShopItemCardKeeper>().ShowItemDetails(itemSlot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Chest content manager
|
||||||
|
// gest new elements list after open chest
|
||||||
|
// remove: -> remove from list, (binding) update list in chest
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 66c5355517f64f558a08ba75b98d4fb0
|
||||||
|
timeCreated: 1670939743
|
3
Assets/Scripts/REFACTORING/Application/UI/Shop.meta
Normal file
3
Assets/Scripts/REFACTORING/Application/UI/Shop.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e1e52654453b412e87f740d47e3757ee
|
||||||
|
timeCreated: 1670938603
|
@ -0,0 +1,113 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class ShopContentUIManager : UIWarehouseManager
|
||||||
|
{
|
||||||
|
public static new ShopContentUIManager Instance { get; protected set; }
|
||||||
|
|
||||||
|
public override int SLOTS_NUMBER { get { return 24; } }
|
||||||
|
|
||||||
|
public const string ITEM_LOCALIZATION = "UiPanels/";
|
||||||
|
public const string PANEL_NAME = null;
|
||||||
|
|
||||||
|
public void Awake()
|
||||||
|
{
|
||||||
|
if (Instance == null)
|
||||||
|
{
|
||||||
|
Instance = this;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log(Instance);
|
||||||
|
Debug.Log("destroiy shop UI");
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
public override void UpdateList()
|
||||||
|
{
|
||||||
|
// TODO something like rebuild associated panel content
|
||||||
|
// depending on which class we use it mayu be Inventory / Chest / Shop Panel Controller
|
||||||
|
DynamicPanel.GetComponent<InventoryPanelController>(); //.Refresh() -- rebuild content
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public void Update()
|
||||||
|
{
|
||||||
|
// use empty function to override parent Update
|
||||||
|
// to prevent using Open Panel and Close Panel!!!
|
||||||
|
// this UI manager mustn't open panel - only manage passed chest content and return updated data
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OpenPanel() { return true; }
|
||||||
|
public bool ClosePanel() { return true; }
|
||||||
|
protected override GameObject GetTemplatePanel() { throw new System.NotImplementedException(); }
|
||||||
|
|
||||||
|
|
||||||
|
public override void SetupPanel()
|
||||||
|
{
|
||||||
|
base.SetupPanel();
|
||||||
|
|
||||||
|
// setup models list
|
||||||
|
DynamicPanel.GetComponent<ShopPanelController>().SetUp(Elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void UpdateList()
|
||||||
|
{
|
||||||
|
DynamicPanel.GetComponent<ShopPanelController>().BuildPanelContent(Elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region adust parent function
|
||||||
|
public override void Add(IndexValuePair<int, EquippableItem> itemOnSlot)
|
||||||
|
{
|
||||||
|
base.Add(itemOnSlot);
|
||||||
|
|
||||||
|
UpdateShopContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Add(EquippableItem item)
|
||||||
|
{
|
||||||
|
base.Add(item);
|
||||||
|
|
||||||
|
UpdateShopContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RemoveByPosition(int keyPosition)
|
||||||
|
{
|
||||||
|
base.RemoveByPosition(keyPosition);
|
||||||
|
|
||||||
|
UpdateShopContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int RemoveByItemId(int itemId)
|
||||||
|
{
|
||||||
|
var result = base.RemoveByItemId(itemId);
|
||||||
|
|
||||||
|
UpdateShopContent();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int RemoveByItemName(string itemName)
|
||||||
|
{
|
||||||
|
var result = base.RemoveByItemName(itemName);
|
||||||
|
|
||||||
|
UpdateShopContent();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RemoveAll()
|
||||||
|
{
|
||||||
|
Elements.Clear();
|
||||||
|
|
||||||
|
UpdateShopContent();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private void UpdateShopContent()
|
||||||
|
{
|
||||||
|
ShopUIManager.Instance.UpdateShopContent(SceneManager.GetActiveScene().name, ShopUIManager.Instance.CurrentShopOwnerName, Elements);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 703bf6cf8b4d9d949a3bf7543e072e30
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
108
Assets/Scripts/REFACTORING/Application/UI/Shop/ShopUIManager.cs
Normal file
108
Assets/Scripts/REFACTORING/Application/UI/Shop/ShopUIManager.cs
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class ShopUIManager : UIBaseManager<Shop>
|
||||||
|
{
|
||||||
|
public new static ShopUIManager Instance { get; private set; }
|
||||||
|
|
||||||
|
public const string ITEM_LOCALIZATION = "UiPanels/Shop/";
|
||||||
|
public const string PANEL_NAME = "ShopPanel";
|
||||||
|
//public int SLOTS_NUMBER => 24;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Keys pair to detect chest
|
||||||
|
/// </summary>
|
||||||
|
[Space]
|
||||||
|
[Header("Current shop unique keys")]
|
||||||
|
public string CurrentShopOwnerName = null; // OR NPC NAME
|
||||||
|
|
||||||
|
public void Awake()
|
||||||
|
{
|
||||||
|
if (Instance == null)
|
||||||
|
{
|
||||||
|
Instance = this;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool OpenPanel()
|
||||||
|
{
|
||||||
|
if (CurrentShopOwnerName == null || CurrentShopOwnerName == "")
|
||||||
|
{
|
||||||
|
Debug.Log($"You re not in range of any shop");
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open additionals panels
|
||||||
|
if (!InventoryUIManager.Instance.GetPanelStatus()) InventoryUIManager.Instance.OpenPanel();
|
||||||
|
|
||||||
|
return base.OpenPanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool ClosePanel()
|
||||||
|
{
|
||||||
|
base.ClosePanel();
|
||||||
|
|
||||||
|
ShopContentUIManager.Instance.DynamicPanel = null;
|
||||||
|
|
||||||
|
// Close additionals panels
|
||||||
|
if (InventoryUIManager.Instance.GetPanelStatus()) InventoryUIManager.Instance.ClosePanel();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetupPanel()
|
||||||
|
{
|
||||||
|
base.SetupPanel();
|
||||||
|
|
||||||
|
var shop = FindShopInCollection(SceneManager.GetActiveScene().name, CurrentShopOwnerName);
|
||||||
|
if (shop == null)
|
||||||
|
throw new Exception($"Shop {CurrentShopOwnerName} not found");
|
||||||
|
|
||||||
|
Debug.Log("Shop UI setupPanel");
|
||||||
|
|
||||||
|
ShopContentUIManager.Instance.SetList(shop.GetContent());
|
||||||
|
ShopContentUIManager.Instance.DynamicPanel = DynamicPanel;
|
||||||
|
ShopContentUIManager.Instance.SetupPanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void UpdateList()
|
||||||
|
{
|
||||||
|
if (CurrentShopOwnerName == null || CurrentShopOwnerName == "")
|
||||||
|
throw new Exception($"You re not in collision with any chest");
|
||||||
|
|
||||||
|
|
||||||
|
var shop = FindShopInCollection(SceneManager.GetActiveScene().name, CurrentShopOwnerName);
|
||||||
|
if (shop == null)
|
||||||
|
throw new Exception($"Chest {CurrentShopOwnerName} not found");
|
||||||
|
|
||||||
|
ShopContentUIManager.Instance.SetList(shop.GetContent());
|
||||||
|
ShopContentUIManager.Instance.DynamicPanel = DynamicPanel;
|
||||||
|
ShopContentUIManager.Instance.UpdateList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateShopContent(string mapName, string shopOwnerName, List<IndexValuePair<int, EquippableItem>> chestContent)
|
||||||
|
{
|
||||||
|
Elements.Where(shop => shop.Map == mapName && shop.Npc == shopOwnerName).ToList().ForEach(shop => shop.SetContent(chestContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override GameObject GetTemplatePanel()
|
||||||
|
{
|
||||||
|
// Resources = default path - Asset/Resources ... .obj
|
||||||
|
return Resources.Load(ITEM_LOCALIZATION + PANEL_NAME) as GameObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Shop FindShopInCollection(string _mapName, string _shopOwnerName)
|
||||||
|
{
|
||||||
|
Elements.ForEach(el => Debug.Log(el.Npc + " - " + el.Map));
|
||||||
|
return Elements.Find(shop => shop.Map == _mapName && shop.Npc == _shopOwnerName);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4d0be1073753419b9be341d0f373ba56
|
||||||
|
timeCreated: 1670938751
|
@ -21,7 +21,7 @@ public class EquippableItem : Item
|
|||||||
|
|
||||||
public EquippableItem(Item _item) : base(_item) {}
|
public EquippableItem(Item _item) : base(_item) {}
|
||||||
|
|
||||||
public EquippableItem(EquippableItem _item) : base(_item.name, _item.description, _item.level, _item.itemModel, _item.image)
|
public EquippableItem(EquippableItem _item) : base(_item.name, _item.description, _item.level, _item.value, _item.price, _item.itemModel, _item.image)
|
||||||
{
|
{
|
||||||
StrengthBonus = _item.StrengthBonus;
|
StrengthBonus = _item.StrengthBonus;
|
||||||
AgilityBonus = _item.AgilityBonus;
|
AgilityBonus = _item.AgilityBonus;
|
||||||
@ -31,6 +31,6 @@ public class EquippableItem : Item
|
|||||||
EquipmentType = _item.EquipmentType;
|
EquipmentType = _item.EquipmentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EquippableItem(string _name, string _description, int _level, GameObject _itemModel, Sprite _image) : base(_name, _description, _level, _itemModel, _image) { }
|
public EquippableItem(string _name, string _description, int _level, int _value, int _price, GameObject _itemModel, Sprite _image) : base(_name, _description, _level, _value, _price, _itemModel, _image) { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
@ -35,6 +37,13 @@ public class Item : ScriptableObject
|
|||||||
set { level = value; }
|
set { level = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int value;
|
||||||
|
public int Value
|
||||||
|
{
|
||||||
|
get { return value; }
|
||||||
|
set { this.value = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Sprite image;
|
public Sprite image;
|
||||||
public Sprite Image
|
public Sprite Image
|
||||||
{
|
{
|
||||||
@ -50,6 +59,15 @@ public class Item : ScriptableObject
|
|||||||
set { itemModel = value; }
|
set { itemModel = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int price;
|
||||||
|
public int Price
|
||||||
|
{
|
||||||
|
get { return price; }
|
||||||
|
set { price = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public UnityEvent useEffect = new UnityEvent();
|
||||||
public Item() {}
|
public Item() {}
|
||||||
|
|
||||||
public Item(Item _item)
|
public Item(Item _item)
|
||||||
@ -57,32 +75,37 @@ public class Item : ScriptableObject
|
|||||||
this.Name = _item.Name;
|
this.Name = _item.Name;
|
||||||
this.Description = _item.Description;
|
this.Description = _item.Description;
|
||||||
this.Level = _item.Level;
|
this.Level = _item.Level;
|
||||||
|
this.Value = _item.Value;
|
||||||
|
this.Price = _item.price;
|
||||||
this.ItemModel = _item.ItemModel;
|
this.ItemModel = _item.ItemModel;
|
||||||
this.Image = _item.Image;
|
this.Image = _item.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Item(string _name, string _description, int _level, GameObject _itemModel, Sprite _image)
|
public Item(string _name, string _description, int _level, int _value, GameObject _itemModel, Sprite _image)
|
||||||
{
|
{
|
||||||
this.Name = _name;
|
this.Name = _name;
|
||||||
this.Description = _description;
|
this.Description = _description;
|
||||||
this.Level = _level;
|
this.Level = _level;
|
||||||
|
this.Value = _value;
|
||||||
this.ItemModel = _itemModel;
|
this.ItemModel = _itemModel;
|
||||||
this.Image = _image;
|
this.Image = _image;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void SaveItem()
|
public Item(string _name, string _description, int _level, int _value, int _price, GameObject _itemModel, Sprite _image)
|
||||||
// {
|
{
|
||||||
// SaveItemSystem.SaveItem(this);
|
this.Name = _name;
|
||||||
// }
|
this.Description = _description;
|
||||||
|
this.Level = _level;
|
||||||
|
this.Value = _value;
|
||||||
|
this.Price = _price;
|
||||||
|
this.ItemModel = _itemModel;
|
||||||
|
this.Image = _image;
|
||||||
|
}
|
||||||
|
|
||||||
// public void LoadItem()
|
|
||||||
// {
|
|
||||||
// ItemData data = SaveItemSystem.LoadIten();
|
|
||||||
|
|
||||||
// id = data.id;
|
public void InvokeEffectAction()
|
||||||
// name = data.name;
|
{
|
||||||
// description = data.description;
|
Debug.Log($"Use {name} effect");
|
||||||
// level = data.level;
|
useEffect.Invoke();
|
||||||
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,12 @@ public abstract class ItemData : ModelData<Item, Item>
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
public int level;
|
public int level;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int value;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int price;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
public string imageName;
|
public string imageName;
|
||||||
|
|
||||||
@ -21,6 +27,8 @@ public abstract class ItemData : ModelData<Item, Item>
|
|||||||
{
|
{
|
||||||
description = item.description;
|
description = item.description;
|
||||||
level = item.level;
|
level = item.level;
|
||||||
|
value = item.value;
|
||||||
|
price = item.price;
|
||||||
imageName = item.image.name;
|
imageName = item.image.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ public interface ISlot
|
|||||||
event Action<ItemSlot> OnEndDragEvent;
|
event Action<ItemSlot> OnEndDragEvent;
|
||||||
event Action<ItemSlot> OnDragEvent;
|
event Action<ItemSlot> OnDragEvent;
|
||||||
event Action<ItemSlot> OnDropEvent;
|
event Action<ItemSlot> OnDropEvent;
|
||||||
|
event Action<ItemSlot, PointerEventData> OnPointerClickEvent;
|
||||||
//(B)Islot // as B
|
//(B)Islot // as B
|
||||||
|
|
||||||
public void SetupSlot(int _number, EquippableItem _item, WarehousePanelController _PanelController);
|
public void SetupSlot(int _number, EquippableItem _item, WarehousePanelController _PanelController);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
@ -6,7 +6,7 @@ using UnityEngine.UI;
|
|||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using System; // for Action type
|
using System; // for Action type
|
||||||
|
|
||||||
public class ItemSlot : MonoBehaviour, ISlot, IBeginDragHandler, IEndDragHandler, IDragHandler, IDropHandler
|
public class ItemSlot : MonoBehaviour, ISlot, IBeginDragHandler, IEndDragHandler, IDragHandler, IDropHandler, IPointerClickHandler
|
||||||
{
|
{
|
||||||
[Header("UI Stuff to change")]
|
[Header("UI Stuff to change")]
|
||||||
[SerializeField] private TextMeshProUGUI slotItemNumberText;
|
[SerializeField] private TextMeshProUGUI slotItemNumberText;
|
||||||
@ -47,6 +47,7 @@ public class ItemSlot : MonoBehaviour, ISlot, IBeginDragHandler, IEndDragHandler
|
|||||||
public event Action<ItemSlot> OnEndDragEvent;
|
public event Action<ItemSlot> OnEndDragEvent;
|
||||||
public event Action<ItemSlot> OnDragEvent;
|
public event Action<ItemSlot> OnDragEvent;
|
||||||
public event Action<ItemSlot> OnDropEvent;
|
public event Action<ItemSlot> OnDropEvent;
|
||||||
|
public event Action<ItemSlot, PointerEventData> OnPointerClickEvent;
|
||||||
|
|
||||||
/* public ItemSlot() { }
|
/* public ItemSlot() { }
|
||||||
public ItemSlot(int number, EquippableItem item = null)
|
public ItemSlot(int number, EquippableItem item = null)
|
||||||
@ -54,15 +55,15 @@ public class ItemSlot : MonoBehaviour, ISlot, IBeginDragHandler, IEndDragHandler
|
|||||||
Number = number;
|
Number = number;
|
||||||
Item = item;
|
Item = item;
|
||||||
}*/
|
}*/
|
||||||
/*
|
/*
|
||||||
public ItemSlot(ItemSlot slot)
|
public ItemSlot(ItemSlot slot)
|
||||||
{
|
{
|
||||||
Number = slot.Number;
|
Number = slot.Number;
|
||||||
Item = slot.Item;
|
Item = slot.Item;
|
||||||
|
|
||||||
slotItemNumberText = slot.slotItemNumberText;
|
slotItemNumberText = slot.slotItemNumberText;
|
||||||
itemImage = slot.itemImage;
|
itemImage = slot.itemImage;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public void SetupSlot(int _number, EquippableItem _item, WarehousePanelController _PanelController)
|
public void SetupSlot(int _number, EquippableItem _item, WarehousePanelController _PanelController)
|
||||||
{
|
{
|
||||||
@ -154,5 +155,11 @@ public class ItemSlot : MonoBehaviour, ISlot, IBeginDragHandler, IEndDragHandler
|
|||||||
if(OnDropEvent != null)
|
if(OnDropEvent != null)
|
||||||
OnDropEvent(this);
|
OnDropEvent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnPointerClick(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (OnPointerClickEvent != null)
|
||||||
|
OnPointerClickEvent(this, eventData);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
26
Assets/Scripts/REFACTORING/Models/Panel/Slot/ShopSlot.cs
Normal file
26
Assets/Scripts/REFACTORING/Models/Panel/Slot/ShopSlot.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
public class ShopSlot : ItemSlot
|
||||||
|
{
|
||||||
|
/* public ShopSlot(int number, Item item): base(number, item)
|
||||||
|
{
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public override bool CanReceiveItem(Item item)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// // allow to put item only when slot is empty
|
||||||
|
// if(Item == null)
|
||||||
|
// return true;
|
||||||
|
|
||||||
|
// EquippableItem equippableItem = item as EquippableItem;
|
||||||
|
// return equippableItem == null;
|
||||||
|
// // what when player try drop putted equipment fowart to chest
|
||||||
|
// // what when player try put item on unempty field
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6bf41236973acd14caf4428b908d0674
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -2,7 +2,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public abstract class ModelData<T, V>
|
public abstract class ModelData<T, V> : IModelMapper<T>
|
||||||
{
|
{
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
public int id;
|
public int id;
|
||||||
@ -18,6 +18,8 @@ public abstract class ModelData<T, V>
|
|||||||
|
|
||||||
protected virtual string MODEL_LOCALIZATION => "";
|
protected virtual string MODEL_LOCALIZATION => "";
|
||||||
|
|
||||||
|
public ModelData() { }
|
||||||
|
|
||||||
public ModelData(int _id, string _name)
|
public ModelData(int _id, string _name)
|
||||||
{
|
{
|
||||||
id = _id;
|
id = _id;
|
||||||
@ -30,10 +32,9 @@ public abstract class ModelData<T, V>
|
|||||||
name = _name;
|
name = _name;
|
||||||
modelName = _modelName; // name of the prefab
|
modelName = _modelName; // name of the prefab
|
||||||
}
|
}
|
||||||
|
protected abstract V TryFindResource(string modelName);
|
||||||
|
|
||||||
public abstract T MapDataToObject(string prefarbAssetName);
|
public abstract T MapDataToObject(string prefarbAssetName);
|
||||||
|
|
||||||
public abstract T MapDataToObject();
|
public abstract T MapDataToObject();
|
||||||
|
|
||||||
protected abstract V TryFindResource(string modelName);
|
|
||||||
}
|
}
|
8
Assets/Scripts/REFACTORING/Models/Shop.meta
Normal file
8
Assets/Scripts/REFACTORING/Models/Shop.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: af03d81ce8418c445a237cd953ac7746
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
91
Assets/Scripts/REFACTORING/Models/Shop/Shop.cs
Normal file
91
Assets/Scripts/REFACTORING/Models/Shop/Shop.cs
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class Shop
|
||||||
|
{
|
||||||
|
[NonSerialized]
|
||||||
|
public string Npc;
|
||||||
|
|
||||||
|
[NonSerialized]
|
||||||
|
public string Map;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<IndexValuePair<int, EquippableItem>> Content = new List<IndexValuePair<int, EquippableItem>>();
|
||||||
|
|
||||||
|
public Shop(string _map)
|
||||||
|
{
|
||||||
|
Map = _map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Shop(string _map, string _npc)
|
||||||
|
{
|
||||||
|
Map = _map;
|
||||||
|
Npc = _npc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Shop(string _map, string _npc, List<IndexValuePair<int, EquippableItem>> _content)
|
||||||
|
{
|
||||||
|
Map = _map;
|
||||||
|
Npc = _npc;
|
||||||
|
Content = _content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetContent(List<IndexValuePair<int, EquippableItem>> _content)
|
||||||
|
{
|
||||||
|
Content = _content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<IndexValuePair<int, EquippableItem>> GetContent()
|
||||||
|
{
|
||||||
|
return Content;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region item
|
||||||
|
public void AddItemToShop(Item _item)
|
||||||
|
{
|
||||||
|
int firstEmptyPosition = FindFirstEmptyPosition();
|
||||||
|
|
||||||
|
Content.Add(new IndexValuePair<int, EquippableItem>(firstEmptyPosition, (EquippableItem)_item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddItemToShopOnPosition(int _position, Item _item)
|
||||||
|
{
|
||||||
|
Content.Add(new IndexValuePair<int, EquippableItem>(_position, (EquippableItem)_item));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region equippable item
|
||||||
|
public void AddItemToShop(EquippableItem _item)
|
||||||
|
{
|
||||||
|
int firstEmptyPosition = FindFirstEmptyPosition();
|
||||||
|
|
||||||
|
Content.Add(new IndexValuePair<int, EquippableItem>(firstEmptyPosition, _item));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddItemToShopOnPosition(int _position, EquippableItem _item)
|
||||||
|
{
|
||||||
|
Content.Add(new IndexValuePair<int, EquippableItem>(_position, _item));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public int FindFirstEmptyPosition()
|
||||||
|
{
|
||||||
|
if (Content.Any())
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Content.Count(); i++)
|
||||||
|
{
|
||||||
|
if (Content.Count(el => el.Key == i && el.Value != null) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/REFACTORING/Models/Shop/Shop.cs.meta
Normal file
11
Assets/Scripts/REFACTORING/Models/Shop/Shop.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0490e96226021924b891436f9071aca7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
55
Assets/Scripts/REFACTORING/Models/Shop/ShopData.cs
Normal file
55
Assets/Scripts/REFACTORING/Models/Shop/ShopData.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class ShopData : IModelMapper<Shop>
|
||||||
|
{
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<IndexValuePair<int, EquippableItemData>> content = new List<IndexValuePair<int, EquippableItemData>>();
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public string Map;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public string NpcName;
|
||||||
|
|
||||||
|
public ShopData(Shop shop)
|
||||||
|
{
|
||||||
|
Map = shop.Map;
|
||||||
|
NpcName = shop.Npc;
|
||||||
|
|
||||||
|
foreach (IndexValuePair<int, EquippableItem> item in shop.Content)
|
||||||
|
{
|
||||||
|
content.Add(
|
||||||
|
new IndexValuePair<int, EquippableItemData>(item.Key, new EquippableItemData(item.Value))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Shop MapDataToObject()
|
||||||
|
{
|
||||||
|
var shop = new Shop(Map, NpcName);
|
||||||
|
|
||||||
|
shop.Content.Clear();
|
||||||
|
|
||||||
|
foreach (IndexValuePair<int, EquippableItemData> item in content)
|
||||||
|
{
|
||||||
|
var castedObject = item.Value.MapDataToObject() as EquippableItem;
|
||||||
|
|
||||||
|
if (castedObject == null)
|
||||||
|
shop.Content.Add(
|
||||||
|
new IndexValuePair<int, EquippableItem>(item.Key, new EquippableItem(item.Value.MapDataToObject()))
|
||||||
|
);
|
||||||
|
else
|
||||||
|
shop.Content.Add(
|
||||||
|
new IndexValuePair<int, EquippableItem>(item.Key, castedObject)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return shop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Shop MapDataToObject(string prefarbAssetName) { throw new System.NotImplementedException(); }
|
||||||
|
}
|
11
Assets/Scripts/REFACTORING/Models/Shop/ShopData.cs.meta
Normal file
11
Assets/Scripts/REFACTORING/Models/Shop/ShopData.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 28e57ba1626c78244b20f9ee261cac1c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Scripts/REFACTORING/Story.meta
Normal file
8
Assets/Scripts/REFACTORING/Story.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 429e6ec48b6b6cd4c93c3b8cb6bba0d6
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Scripts/REFACTORING/Story/WizardHouse.meta
Normal file
8
Assets/Scripts/REFACTORING/Story/WizardHouse.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bd4cef05b2907f4449fc832dfe3140e5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 97fdd6676eec8fe4a9ae7f14adcb6366
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -3,6 +3,10 @@ using System.Collections.Generic;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IMPOSRTANT
|
||||||
|
* All methods must be binded in buttons actions list responsible for saving
|
||||||
|
*/
|
||||||
public class SaveController : MonoBehaviour
|
public class SaveController : MonoBehaviour
|
||||||
{
|
{
|
||||||
public void SaveScene()
|
public void SaveScene()
|
||||||
@ -26,6 +30,7 @@ public class SaveController : MonoBehaviour
|
|||||||
player.GetComponent<Player>().SaveCheckpoint();
|
player.GetComponent<Player>().SaveCheckpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region palyer panels data
|
||||||
public void SavePlayerEquipmentItems() // toDO change name to save Equipment - save items will save items on map eg after drops
|
public void SavePlayerEquipmentItems() // toDO change name to save Equipment - save items will save items on map eg after drops
|
||||||
{
|
{
|
||||||
EquipmentDataManager.Instance.SaveDynamicData();
|
EquipmentDataManager.Instance.SaveDynamicData();
|
||||||
@ -42,6 +47,7 @@ public class SaveController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
SceneInventoryDataManager.Instance.SaveDynamicData();
|
SceneInventoryDataManager.Instance.SaveDynamicData();
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public void SaveChests()
|
public void SaveChests()
|
||||||
{
|
{
|
||||||
@ -50,4 +56,10 @@ public class SaveController : MonoBehaviour
|
|||||||
if(SceneChestDataManager.Instance)
|
if(SceneChestDataManager.Instance)
|
||||||
SceneChestDataManager.Instance.SaveDynamicData();
|
SceneChestDataManager.Instance.SaveDynamicData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SaveShops()
|
||||||
|
{
|
||||||
|
if(SceneShopDataManager.Instance)
|
||||||
|
SceneShopDataManager.Instance.SaveDynamicData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user