diff --git a/Assets/Prefab/GameCanvas.prefab b/Assets/Prefab/GameCanvas.prefab index 88610d87..7b4868cc 100644 --- a/Assets/Prefab/GameCanvas.prefab +++ b/Assets/Prefab/GameCanvas.prefab @@ -33,6 +33,7 @@ RectTransform: m_Children: - {fileID: 5903238893732464861} - {fileID: 5903238893920995269} + - {fileID: 5909765210375931188} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -116,6 +117,7 @@ MonoBehaviour: m_EditorClassIdentifier: moveJoystick: {fileID: 5903238893732464856} attackJoystick: {fileID: 5903238893920995264} + placeJoystick: {fileID: 5909765210375931185} --- !u!1001 &2346010270301780417 PrefabInstance: m_ObjectHideFlags: 0 @@ -171,7 +173,7 @@ PrefabInstance: - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} propertyPath: m_SizeDelta.y - value: -200 + value: -600 objectReference: {fileID: 0} - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} @@ -226,7 +228,7 @@ PrefabInstance: - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 400 objectReference: {fileID: 0} - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} @@ -365,7 +367,7 @@ PrefabInstance: - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} propertyPath: m_SizeDelta.y - value: -200 + value: -600 objectReference: {fileID: 0} - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} @@ -410,7 +412,7 @@ PrefabInstance: - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 400 objectReference: {fileID: 0} - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} @@ -477,3 +479,197 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a47f546fc70ec8428172694e78e4288, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1001 &2549463672493996848 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2346010271288414180} + m_Modifications: + - target: {fileID: 8170153791668043265, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: deadZone + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchorMin.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_SizeDelta.x + value: 400 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_SizeDelta.y + value: -600 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchoredPosition.x + value: -400 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 400 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8170153791668043269, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_Name + value: PlaceJoystic + objectReference: {fileID: 0} + - target: {fileID: 8170153791961219456, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_SizeDelta.x + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 8170153791961219456, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_SizeDelta.y + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 8170153791961219459, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 271a63d73be51f64dbf31b6b20b0fcb2, + type: 3} + - target: {fileID: 8170153792821263252, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 2f51e0c9d4b837c419aab13bd3a5a8c9, + type: 3} + - target: {fileID: 8170153792821263258, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_SizeDelta.x + value: 512 + objectReference: {fileID: 0} + - target: {fileID: 8170153792821263258, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_SizeDelta.y + value: 512 + objectReference: {fileID: 0} + - target: {fileID: 8170153792821263258, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 222 + objectReference: {fileID: 0} + - target: {fileID: 8170153792821263258, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 140 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 0d230cc8be529a542a08cb878ab14b18, type: 3} +--- !u!224 &5909765210375931188 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 8170153791668043268, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + m_PrefabInstance: {fileID: 2549463672493996848} + m_PrefabAsset: {fileID: 0} +--- !u!114 &5909765210375931185 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8170153791668043265, guid: 0d230cc8be529a542a08cb878ab14b18, + type: 3} + m_PrefabInstance: {fileID: 2549463672493996848} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a47f546fc70ec8428172694e78e4288, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefab/InventoryCanas.prefab b/Assets/Prefab/InventoryCanas.prefab new file mode 100644 index 00000000..2d23cf26 --- /dev/null +++ b/Assets/Prefab/InventoryCanas.prefab @@ -0,0 +1,179 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1967491301176557388 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5757677100394197073} + - component: {fileID: 5200306858852700959} + - component: {fileID: 5828887965330480077} + - component: {fileID: 5815360006936303551} + - component: {fileID: 1527356263590969195} + m_Layer: 5 + m_Name: InventoryCanas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5757677100394197073 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967491301176557388} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 2902167093541798520} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &5200306858852700959 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967491301176557388} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &5828887965330480077 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967491301176557388} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1080, y: 1920} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &5815360006936303551 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967491301176557388} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1527356263590969195 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967491301176557388} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e0b3f756d0c46044ca44448fe3582300, type: 3} + m_Name: + m_EditorClassIdentifier: + item: {fileID: 4221355843481402267, guid: da3203b630d1ce446b635338ac488223, type: 3} + grid: {fileID: 2902167093541798523} +--- !u!1 &2902167093541798523 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2902167093541798520} + - component: {fileID: 2902167093541798521} + m_Layer: 5 + m_Name: ItemGroup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2902167093541798520 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2902167093541798523} + 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_Children: [] + m_Father: {fileID: 5757677100394197073} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 231} + m_SizeDelta: {x: 0, y: 228.46094} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2902167093541798521 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2902167093541798523} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 4 + m_Spacing: -180 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 diff --git a/Assets/Scripts/NewMenu.meta b/Assets/Prefab/InventoryCanas.prefab.meta similarity index 57% rename from Assets/Scripts/NewMenu.meta rename to Assets/Prefab/InventoryCanas.prefab.meta index 7c9658ba..d8b874fb 100644 --- a/Assets/Scripts/NewMenu.meta +++ b/Assets/Prefab/InventoryCanas.prefab.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: 8143a9ada3328cd47be0140d3ea73d5d -folderAsset: yes -DefaultImporter: +guid: ff3bc3b17ddefd14eb798b22cf0a854f +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Prefab/ItemView.prefab b/Assets/Prefab/ItemView.prefab new file mode 100644 index 00000000..b019464e --- /dev/null +++ b/Assets/Prefab/ItemView.prefab @@ -0,0 +1,198 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4221355843481402267 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4221355843481402266} + - component: {fileID: 4221355843481402340} + - component: {fileID: 4221355843481402341} + m_Layer: 5 + m_Name: ItemView + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4221355843481402266 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355843481402267} + 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_Children: + - {fileID: 4221355844459984379} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 405, y: 422} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4221355843481402340 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355843481402267} + m_CullTransparentMesh: 1 +--- !u!114 &4221355843481402341 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355843481402267} + 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: c965160d8643b4ceb8a96e344d4fe2ff, 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!1 &4221355844459984376 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4221355844459984379} + - component: {fileID: 4221355844459984324} + - component: {fileID: 4221355844459984325} + - component: {fileID: 4221355844459984378} + m_Layer: 5 + m_Name: Item + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4221355844459984379 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355844459984376} + 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_Children: [] + m_Father: {fileID: 4221355843481402266} + 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: 208, y: 208} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4221355844459984324 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355844459984376} + m_CullTransparentMesh: 1 +--- !u!114 &4221355844459984325 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355844459984376} + 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: caf8bc0311dd2fc4ca1528a82a063754, 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 &4221355844459984378 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4221355844459984376} + 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: 4221355844459984325} + m_OnClick: + m_PersistentCalls: + m_Calls: [] diff --git a/Assets/Prefab/ItemView.prefab.meta b/Assets/Prefab/ItemView.prefab.meta new file mode 100644 index 00000000..22ca2232 --- /dev/null +++ b/Assets/Prefab/ItemView.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: da3203b630d1ce446b635338ac488223 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Data/CameraData.asset b/Assets/Resources/Data/CameraData.asset index ea8495ce..b531d3c5 100644 --- a/Assets/Resources/Data/CameraData.asset +++ b/Assets/Resources/Data/CameraData.asset @@ -12,5 +12,5 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 83b1020f31bf45569f5af6c77fc77d4e, type: 3} m_Name: CameraData m_EditorClassIdentifier: - offset: {x: 0, y: 25, z: -10} + offset: {x: 0, y: 20, z: -10} smoothSpeed: 2 diff --git a/Assets/Resources/Data/Data.asset b/Assets/Resources/Data/Data.asset index a46995e1..9d9bc1a3 100644 --- a/Assets/Resources/Data/Data.asset +++ b/Assets/Resources/Data/Data.asset @@ -18,4 +18,5 @@ MonoBehaviour: weaponDataPath: WeaponsData uiDataPath: UIData musicDataPath: MusicData + itemDataPath: ItemData chosenWeaponDataPath: ChosenWeapon.json diff --git a/Assets/Resources/Data/ItemData.asset b/Assets/Resources/Data/ItemData.asset new file mode 100644 index 00000000..c3613682 --- /dev/null +++ b/Assets/Resources/Data/ItemData.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: effbc11b6ae8444c8d20e929ce28183e, type: 3} + m_Name: ItemData + m_EditorClassIdentifier: + itemInfos: + - prefab: {fileID: 3197816592181874056, guid: 2704c4f795b0d7748a3e3fa53be4d893, + type: 3} + isInstantUse: 0 + type: Tower + icon: {fileID: 21300000, guid: 543c4732bd2d47a41bdbbf2156eb358c, type: 3} + spawnablePrefab: {fileID: 1175122412763585952, guid: ca39954219550f949aeeecf95f25f3d1, + type: 3} + fromTimeSpawn: 3 + toTimeSpawn: 10 diff --git a/Assets/Resources/Data/ItemData.asset.meta b/Assets/Resources/Data/ItemData.asset.meta new file mode 100644 index 00000000..018c1702 --- /dev/null +++ b/Assets/Resources/Data/ItemData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61b36bbea9deaf3429a93f65e1bdb53e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Data/LevelData.asset b/Assets/Resources/Data/LevelData.asset index 1c59e564..07dc6712 100644 --- a/Assets/Resources/Data/LevelData.asset +++ b/Assets/Resources/Data/LevelData.asset @@ -15,5 +15,3 @@ MonoBehaviour: levels: - sceneName: Level 1 levelSprite: {fileID: 21300000, guid: 8bc240b354e7722408178bdcb1bf7b56, type: 3} - - sceneName: Level 2 - levelSprite: {fileID: 21300000, guid: 426478b073313244bbe84d3ec1cafa64, type: 3} diff --git a/Assets/Resources/Data/UIData.asset b/Assets/Resources/Data/UIData.asset index 7ddf5d0c..f5b2cf1b 100644 --- a/Assets/Resources/Data/UIData.asset +++ b/Assets/Resources/Data/UIData.asset @@ -17,3 +17,5 @@ MonoBehaviour: - {fileID: 5296751824488078361, guid: 7305318dc10267546b643a42c7c21af3, type: 3} joystickView: {fileID: 4385872142190176059, guid: 4df6913b39f4979429158c344680d83f, type: 3} + inventoryView: {fileID: 1527356263590969195, guid: ff3bc3b17ddefd14eb798b22cf0a854f, + type: 3} diff --git a/Assets/Resources/Data/UnitsData.asset b/Assets/Resources/Data/UnitsData.asset index fd6155c8..50bb112b 100644 --- a/Assets/Resources/Data/UnitsData.asset +++ b/Assets/Resources/Data/UnitsData.asset @@ -23,6 +23,7 @@ MonoBehaviour: manaRegen: 5 maxMana: 100 maxHP: 100 + inventoryCapacity: 4 - isPlayer: 0 spawnPos: x: 3 @@ -33,6 +34,7 @@ MonoBehaviour: manaRegen: 10 maxMana: 100 maxHP: 100 + inventoryCapacity: 4 - isPlayer: 0 spawnPos: x: 3 @@ -43,3 +45,4 @@ MonoBehaviour: manaRegen: 10 maxMana: 100 maxHP: 100 + inventoryCapacity: 4 diff --git a/Assets/Scenes/Level 1.unity b/Assets/Scenes/Level 1.unity index 9ddf2851..505a911c 100644 --- a/Assets/Scenes/Level 1.unity +++ b/Assets/Scenes/Level 1.unity @@ -267,8 +267,8 @@ Camera: near clip plane: 0.3 far clip plane: 1000 field of view: 60 - orthographic: 0 - orthographic size: 5 + orthographic: 1 + orthographic size: 12 m_Depth: -1 m_CullingMask: serializedVersion: 2 diff --git a/Assets/Scripts/Controller/GameInit.cs b/Assets/Scripts/Controller/GameInit.cs index b4e87339..09cb7fa2 100644 --- a/Assets/Scripts/Controller/GameInit.cs +++ b/Assets/Scripts/Controller/GameInit.cs @@ -1,13 +1,14 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CamControl; using Chars; -using Data; -using DefaultNamespace; using GameUI; using HexFiled; +using Items; using Units; using UnityEngine; using Weapons; +using Random = UnityEngine.Random; namespace Controller { @@ -19,10 +20,14 @@ namespace Controller new MusicController(); MusicController.Instance.SetMusicData(data.MusicData); controllers.Add(hexGrid); + + List types = + new List() { typeof(Tower) }; + ItemFabric itemFabric = new ItemFabric(data.ItemsData, types); + controllers.Add(itemFabric); UIController uiController = new UIController(data.UIData); - uiController.Spawn(); //TODO при паузе - + uiController.Spawn(); //TODO при паузе Dotween ругается Unit player; List units = new List(); data.UnitData.Units.ForEach(unit => @@ -30,7 +35,7 @@ namespace Controller if (unit.isPlayer) { player = new Unit(unit, JsonUtility.FromJson(data.ChosenWeapon), hexGrid); - PlayerControl playerControl = new PlayerControl(player, uiController.PlayerControlView); + PlayerControl playerControl = new PlayerControl(player, uiController.PlayerControlView, uiController.PlayerInventoryView); controllers.Add(playerControl); CameraControl cameraControl = new CameraControl(Camera.main, data.CameraData); @@ -56,6 +61,8 @@ namespace Controller hexGrid.OnHexPainted += paintedController.SetHexColors; + hexGrid.OnHexPainted += itemFabric.UpdateCellToOpenList; + } diff --git a/Assets/Scripts/Data/Data.cs b/Assets/Scripts/Data/Data.cs index 9b0cbf57..b5b2b099 100644 --- a/Assets/Scripts/Data/Data.cs +++ b/Assets/Scripts/Data/Data.cs @@ -20,10 +20,25 @@ namespace Data private UIData _uiData; [SerializeField] private string musicDataPath; private MusicData _musicData; + [SerializeField] private string itemDataPath; + private ItemsData _itemsData; [SerializeField] private string chosenWeaponDataPath; public string ChosenWeapon => File.ReadAllText(Application.persistentDataPath + "/" + chosenWeaponDataPath); + public ItemsData ItemsData + { + get + { + if (_itemsData == null) + { + _itemsData = Load("Data/" + itemDataPath); + } + + return _itemsData; + } + } + public MusicData MusicData { get diff --git a/Assets/Scripts/Data/ItemsData.cs b/Assets/Scripts/Data/ItemsData.cs new file mode 100644 index 00000000..d348a801 --- /dev/null +++ b/Assets/Scripts/Data/ItemsData.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Items; +using UnityEngine; + +namespace Data +{ + [CreateAssetMenu(fileName = "ItemData", menuName = "Data/ItemData", order = 0)] + public class ItemsData : ScriptableObject + { + [SerializeField] + private List itemInfos; + + [SerializeField] private float fromTimeSpawn; + [SerializeField] private float toTimeSpawn; + + public List ItemInfos => itemInfos; + public (float from, float to) SpawnTime => (fromTimeSpawn, toTimeSpawn); + } + + [Serializable] + public struct ItemInfo + { + [SerializeField] private GameObject prefab; + [SerializeField] private bool isInstantUse; + [SerializeField] private string type; + [SerializeField] private Sprite icon; + [SerializeField] private GameObject spawnablePrefab; + public GameObject Prefab => prefab; + public string Type => type; + + public Sprite Icon => icon; + + public GameObject SpawnablePrefab => spawnablePrefab; + + public bool IsInstanceUse => isInstantUse; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Data/ItemsData.cs.meta b/Assets/Scripts/Data/ItemsData.cs.meta new file mode 100644 index 00000000..7f661e00 --- /dev/null +++ b/Assets/Scripts/Data/ItemsData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: effbc11b6ae8444c8d20e929ce28183e +timeCreated: 1641238823 \ No newline at end of file diff --git a/Assets/Scripts/Data/UIData.cs b/Assets/Scripts/Data/UIData.cs index fdb0870d..f3d61ebc 100644 --- a/Assets/Scripts/Data/UIData.cs +++ b/Assets/Scripts/Data/UIData.cs @@ -9,9 +9,10 @@ namespace Data { [SerializeField] private List _objectsToSpawn; [SerializeField] private PlayerControlView joystickView; + [SerializeField] private PlayerInventoryView inventoryView; public List ObjectsToSpawn => _objectsToSpawn; public PlayerControlView PlayerControlView => joystickView; - - + + public PlayerInventoryView InventoryView => inventoryView; } } \ No newline at end of file diff --git a/Assets/Scripts/Data/UnitData.cs b/Assets/Scripts/Data/UnitData.cs index 68e5c0c1..8fb85c70 100644 --- a/Assets/Scripts/Data/UnitData.cs +++ b/Assets/Scripts/Data/UnitData.cs @@ -24,5 +24,6 @@ namespace Data public int manaRegen; public int maxMana; public int maxHP; + public int inventoryCapacity; } } \ No newline at end of file diff --git a/Assets/Scripts/GameUI/PlayerInventoryView.cs b/Assets/Scripts/GameUI/PlayerInventoryView.cs new file mode 100644 index 00000000..f706d0f7 --- /dev/null +++ b/Assets/Scripts/GameUI/PlayerInventoryView.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Items; +using UnityEngine; +using UnityEngine.UI; + +public class PlayerInventoryView : MonoBehaviour +{ + [SerializeField] private GameObject item; + [SerializeField] private GameObject grid; + + public Action OnItemInvoked; + + private List