From b09b799286ce4e17d2963ff4bfb09ab4ce8fb702 Mon Sep 17 00:00:00 2001 From: Ken Schaefer Date: Fri, 30 Jun 2023 10:33:43 -0500 Subject: [PATCH] 2D art implementation --- Space Shooter/Assets/Prefabs/Enemy.prefab | 135 +++++---- Space Shooter/Assets/Prefabs/Laser.prefab | 131 +++++---- .../Assets/Prefabs/Laser.prefab.meta | 2 +- Space Shooter/Assets/Scenes/Game.unity | 277 ++++++++++-------- Space Shooter/Assets/Scripts/Enemy.cs | 2 +- Space Shooter/Assets/Scripts/Player.cs | 2 +- .../ProjectSettings/TagManager.asset | 6 + 7 files changed, 317 insertions(+), 238 deletions(-) diff --git a/Space Shooter/Assets/Prefabs/Enemy.prefab b/Space Shooter/Assets/Prefabs/Enemy.prefab index cdfa0d8..8c8a395 100644 --- a/Space Shooter/Assets/Prefabs/Enemy.prefab +++ b/Space Shooter/Assets/Prefabs/Enemy.prefab @@ -9,11 +9,10 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6259941258914032746} - - component: {fileID: 6018918584238382557} - - component: {fileID: 2651467715335248648} - - component: {fileID: 6368405767543518119} - - component: {fileID: -6678589734583942708} - component: {fileID: 1804272919641829641} + - component: {fileID: 6611673063319168366} + - component: {fileID: 5383761249909364770} + - component: {fileID: 6508592871357767248} m_Layer: 0 m_Name: Enemy m_TagString: Enemy @@ -36,35 +35,40 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &6018918584238382557 -MeshFilter: +--- !u!114 &1804272919641829641 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2435537520388073602} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &2651467715335248648 -MeshRenderer: + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 00338d66c55d5a9429ada0b82e859cfb, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 4 +--- !u!212 &6611673063319168366 +SpriteRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2435537520388073602} m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 m_DynamicOccludee: 1 m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 + m_RayTracingMode: 0 m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 6cdbf59a25f9f8c47a09e2d05fc0dcd8, type: 2} + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -77,22 +81,41 @@ MeshRenderer: m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 + m_SelectedEditorRenderState: 0 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 + m_SortingLayerID: 368669973 + m_SortingLayer: 2 m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!65 &6368405767543518119 -BoxCollider: + m_Sprite: {fileID: 21300000, guid: 3154912113cbb4a498df6f571c74e18c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!50 &5383761249909364770 +Rigidbody2D: + serializedVersion: 4 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2435537520388073602} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 0 m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -100,50 +123,52 @@ BoxCollider: m_ExcludeLayers: serializedVersion: 2 m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 1 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!54 &-6678589734583942708 -Rigidbody: + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &6508592871357767248 +BoxCollider2D: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2435537520388073602} - serializedVersion: 4 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 m_Bits: 0 m_ExcludeLayers: serializedVersion: 2 m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!114 &1804272919641829641 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2435537520388073602} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 00338d66c55d5a9429ada0b82e859cfb, type: 3} - m_Name: - m_EditorClassIdentifier: - speed: 4 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.0066649914, y: 0.121206224} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 5.12, y: 5.12} + newSize: {x: 5.12, y: 5.12} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 2.3074107, y: 2.6697917} + m_EdgeRadius: 0 diff --git a/Space Shooter/Assets/Prefabs/Laser.prefab b/Space Shooter/Assets/Prefabs/Laser.prefab index 540c083..2b127f4 100644 --- a/Space Shooter/Assets/Prefabs/Laser.prefab +++ b/Space Shooter/Assets/Prefabs/Laser.prefab @@ -1,6 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &2705647128521409060 +--- !u!1 &4479679947771370236 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,12 +8,11 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 6667147684356053690} - - component: {fileID: 3441724675315214033} - - component: {fileID: 1972977895775938971} - - component: {fileID: 7348503523116231939} - - component: {fileID: 8639227692084892656} - - component: {fileID: 4222877361310449460} + - component: {fileID: 3146223501030830297} + - component: {fileID: 6755375816300558418} + - component: {fileID: 3305526649427950078} + - component: {fileID: 6791868568186830748} + - component: {fileID: 3027783195961468174} m_Layer: 0 m_Name: Laser m_TagString: Laser @@ -21,50 +20,42 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &6667147684356053690 +--- !u!4 &3146223501030830297 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2705647128521409060} + m_GameObject: {fileID: 4479679947771370236} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 1, z: 0} m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3441724675315214033 -MeshFilter: +--- !u!212 &6755375816300558418 +SpriteRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2705647128521409060} - m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &1972977895775938971 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2705647128521409060} + m_GameObject: {fileID: 4479679947771370236} m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 m_DynamicOccludee: 1 m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 + m_RayTracingMode: 0 m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: d8a01fe8797b7704eb231a4d76e40b61, type: 2} + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -77,22 +68,34 @@ MeshRenderer: m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 + m_SelectedEditorRenderState: 0 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 + m_SortingLayerID: 368669973 + m_SortingLayer: 2 m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!136 &7348503523116231939 -CapsuleCollider: + m_Sprite: {fileID: 21300000, guid: b030d335857201646be69703e678d6e5, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 3} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!61 &3305526649427950078 +BoxCollider2D: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2705647128521409060} + m_GameObject: {fileID: 4479679947771370236} + m_Enabled: 1 + m_Density: 1 m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -101,48 +104,68 @@ CapsuleCollider: serializedVersion: 2 m_Bits: 0 m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 m_IsTrigger: 1 - m_ProvidesContacts: 0 - m_Enabled: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.000000014901161, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 3} + newSize: {x: 1, y: 3} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 serializedVersion: 2 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!54 &8639227692084892656 -Rigidbody: + m_Size: {x: 0.38605735, y: 3} + m_EdgeRadius: 0 +--- !u!50 &6791868568186830748 +Rigidbody2D: + serializedVersion: 4 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2705647128521409060} - serializedVersion: 4 + m_GameObject: {fileID: 4479679947771370236} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 m_Mass: 1 - m_Drag: 0 + m_LinearDrag: 0 m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_GravityScale: 0 + m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 m_Bits: 0 m_ExcludeLayers: serializedVersion: 2 m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 0 - m_IsKinematic: 0 m_Interpolate: 0 - m_Constraints: 0 + m_SleepingMode: 1 m_CollisionDetection: 0 ---- !u!114 &4222877361310449460 + m_Constraints: 0 +--- !u!114 &3027783195961468174 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2705647128521409060} + m_GameObject: {fileID: 4479679947771370236} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f2768c56994b7484aabe727cd12cc691, type: 3} diff --git a/Space Shooter/Assets/Prefabs/Laser.prefab.meta b/Space Shooter/Assets/Prefabs/Laser.prefab.meta index 23a0bb3..e684f14 100644 --- a/Space Shooter/Assets/Prefabs/Laser.prefab.meta +++ b/Space Shooter/Assets/Prefabs/Laser.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1a67b67b6874c634492ea61ed6c00de8 +guid: da03196dd21374e4296d0d8f6fc20b45 PrefabImporter: externalObjects: {} userData: diff --git a/Space Shooter/Assets/Scenes/Game.unity b/Space Shooter/Assets/Scenes/Game.unity index 53ec4a6..ea0c4c8 100644 --- a/Space Shooter/Assets/Scenes/Game.unity +++ b/Space Shooter/Assets/Scenes/Game.unity @@ -154,6 +154,153 @@ Transform: m_Father: {fileID: 1614698418} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &662075114 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 662075117} + - component: {fileID: 662075116} + - component: {fileID: 662075118} + - component: {fileID: 662075115} + m_Layer: 0 + m_Name: Player + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &662075115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662075114} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6a3b9c52ba7f6744bb3b9616baf1d986, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 10 + laserPrefab: {fileID: 4479679947771370236, guid: da03196dd21374e4296d0d8f6fc20b45, type: 3} + fireRate: 0.15 + lives: 3 +--- !u!212 &662075116 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662075114} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 368669973 + m_SortingLayer: 2 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 1b4a8fdd39d3a45d0a9ee484ad6800ec, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &662075117 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662075114} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &662075118 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 662075114} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: -0.015591741, y: 0.071881056} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 5.12, y: 5.12} + newSize: {x: 5.12, y: 5.12} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 3.3945668, y: 4.098965} + m_EdgeRadius: 0 --- !u!1 &693702525 GameObject: m_ObjectHideFlags: 0 @@ -209,8 +356,8 @@ SpriteRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 + m_SortingLayerID: -421889197 + m_SortingLayer: 1 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 351f30ffb741fd643b82bde90a222699, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} @@ -236,7 +383,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1163119377 GameObject: @@ -332,128 +479,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &1601688629 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1601688633} - - component: {fileID: 1601688632} - - component: {fileID: 1601688631} - - component: {fileID: 1601688630} - - component: {fileID: 1601688634} - m_Layer: 0 - m_Name: Player - m_TagString: Player - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!65 &1601688630 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1601688629} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 1 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1601688631 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1601688629} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 76c1e8554d1af074bbd44f5dba537304, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1601688632 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1601688629} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1601688633 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1601688629} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -2.71, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1601688634 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1601688629} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6a3b9c52ba7f6744bb3b9616baf1d986, type: 3} - m_Name: - m_EditorClassIdentifier: - speed: 10 - laserPrefab: {fileID: 2705647128521409060, guid: 1a67b67b6874c634492ea61ed6c00de8, type: 3} - fireRate: 0.5 - lives: 3 --- !u!1 &1614698416 GameObject: m_ObjectHideFlags: 0 @@ -499,7 +524,7 @@ Transform: m_Children: - {fileID: 386510612} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1873826075 GameObject: diff --git a/Space Shooter/Assets/Scripts/Enemy.cs b/Space Shooter/Assets/Scripts/Enemy.cs index 6c60a67..0825c5b 100644 --- a/Space Shooter/Assets/Scripts/Enemy.cs +++ b/Space Shooter/Assets/Scripts/Enemy.cs @@ -23,7 +23,7 @@ public class Enemy : MonoBehaviour } } - void OnTriggerEnter(Collider other) + void OnTriggerEnter2D(Collider2D other) { Debug.Log("Hit: " + other.transform.name); diff --git a/Space Shooter/Assets/Scripts/Player.cs b/Space Shooter/Assets/Scripts/Player.cs index b105c10..7eb3b79 100644 --- a/Space Shooter/Assets/Scripts/Player.cs +++ b/Space Shooter/Assets/Scripts/Player.cs @@ -39,7 +39,7 @@ public class Player : MonoBehaviour private void ShootLaser() { nextFire = Time.time + fireRate; - Instantiate(laserPrefab, transform.position + new Vector3(0, 0.8f, 0), Quaternion.identity); + Instantiate(laserPrefab, transform.position + new Vector3(0, 1.05f, 0), Quaternion.identity); } private void CalculateMovement() diff --git a/Space Shooter/ProjectSettings/TagManager.asset b/Space Shooter/ProjectSettings/TagManager.asset index 77f8233..db9e289 100644 --- a/Space Shooter/ProjectSettings/TagManager.asset +++ b/Space Shooter/ProjectSettings/TagManager.asset @@ -43,3 +43,9 @@ TagManager: - name: Default uniqueID: 0 locked: 0 + - name: Background + uniqueID: 3873078099 + locked: 0 + - name: Foreground + uniqueID: 368669973 + locked: 0