From 531a76ad0965421db8c2d87d3efe36ace9c2583b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 11 Aug 2018 17:58:34 +0200 Subject: [PATCH] Mash of stuff --- Assets/Animations.meta | 8 ++ Assets/Animations/Fish.controller | 11 ++ Assets/Animations/Fish.controller.meta | 8 ++ Assets/Animations/SwimmingFish.anim | 53 +++++++++ Assets/Animations/SwimmingFish.anim.meta | 8 ++ Assets/Materials.meta | 8 ++ Assets/Materials/Chain.mat | 76 +++++++++++++ Assets/Materials/Chain.mat.meta | 8 ++ Assets/Prefabs/Camera.prefab | 2 +- Assets/Prefabs/Chain Link.prefab | 6 +- Assets/Prefabs/ChainAuto.prefab | 2 +- Assets/Prefabs/Fish.prefab | 107 ++++++++++++++++++ .../{_Fish_.prefab.meta => Fish.prefab.meta} | 0 Assets/Prefabs/Harpoon.prefab | 10 +- Assets/Prefabs/Ship.prefab | 60 ++++++++-- Assets/Prefabs/_Fish_.prefab | 41 ------- Assets/Scenes/Game.unity | 39 ++++++- Assets/Scripts/ChainLinker.cs | 40 +++++-- Assets/Scripts/FishSpawner.cs | 3 +- Assets/Scripts/PlayerMovement.cs | 27 ++--- Assets/Scripts/RampinoTester.cs | 22 ++++ Assets/Scripts/RampinoTester.cs.meta | 11 ++ Assets/Sprites/ChainLink.png | 4 +- Assets/Sprites/ChainLink.png.meta | 12 +- Assets/Sprites/Fish1.png | 3 + .../{pesce1.png.meta => Fish1.png.meta} | 35 +++++- Assets/Sprites/Fish2.png | 3 + .../{pesce2.png.meta => Fish2.png.meta} | 35 +++++- Assets/Sprites/pesce1.png | 3 - Assets/Sprites/pesce2.png | 3 - 30 files changed, 543 insertions(+), 105 deletions(-) create mode 100644 Assets/Animations.meta create mode 100644 Assets/Animations/Fish.controller create mode 100644 Assets/Animations/Fish.controller.meta create mode 100644 Assets/Animations/SwimmingFish.anim create mode 100644 Assets/Animations/SwimmingFish.anim.meta create mode 100644 Assets/Materials.meta create mode 100644 Assets/Materials/Chain.mat create mode 100644 Assets/Materials/Chain.mat.meta create mode 100644 Assets/Prefabs/Fish.prefab rename Assets/Prefabs/{_Fish_.prefab.meta => Fish.prefab.meta} (100%) delete mode 100644 Assets/Prefabs/_Fish_.prefab create mode 100644 Assets/Scripts/RampinoTester.cs create mode 100644 Assets/Scripts/RampinoTester.cs.meta create mode 100644 Assets/Sprites/Fish1.png rename Assets/Sprites/{pesce1.png.meta => Fish1.png.meta} (69%) create mode 100644 Assets/Sprites/Fish2.png rename Assets/Sprites/{pesce2.png.meta => Fish2.png.meta} (69%) delete mode 100644 Assets/Sprites/pesce1.png delete mode 100644 Assets/Sprites/pesce2.png diff --git a/Assets/Animations.meta b/Assets/Animations.meta new file mode 100644 index 0000000..1899e82 --- /dev/null +++ b/Assets/Animations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7c972db0274d979489f49c110be83695 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/Fish.controller b/Assets/Animations/Fish.controller new file mode 100644 index 0000000..2019dba --- /dev/null +++ b/Assets/Animations/Fish.controller @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: _Fish_ + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: [] diff --git a/Assets/Animations/Fish.controller.meta b/Assets/Animations/Fish.controller.meta new file mode 100644 index 0000000..50a7384 --- /dev/null +++ b/Assets/Animations/Fish.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bad0282c8547e9444b3d82126cb74259 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/SwimmingFish.anim b/Assets/Animations/SwimmingFish.anim new file mode 100644 index 0000000..79ca26c --- /dev/null +++ b/Assets/Animations/SwimmingFish.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: SwimmingFish + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_GenerateMotionCurves: 0 + m_Events: [] diff --git a/Assets/Animations/SwimmingFish.anim.meta b/Assets/Animations/SwimmingFish.anim.meta new file mode 100644 index 0000000..22d5976 --- /dev/null +++ b/Assets/Animations/SwimmingFish.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69bbcb7123e43354aa536335d9a6ce4b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials.meta b/Assets/Materials.meta new file mode 100644 index 0000000..8c5ef61 --- /dev/null +++ b/Assets/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 626cfc1c46fc40343b6904a98ff25885 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/Chain.mat b/Assets/Materials/Chain.mat new file mode 100644 index 0000000..f0b5889 --- /dev/null +++ b/Assets/Materials/Chain.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Chain + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Materials/Chain.mat.meta b/Assets/Materials/Chain.mat.meta new file mode 100644 index 0000000..d3f6fdf --- /dev/null +++ b/Assets/Materials/Chain.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9009a0cf56984e848b674cf0ba6637b8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Camera.prefab b/Assets/Prefabs/Camera.prefab index a45aa7c..717afa2 100644 --- a/Assets/Prefabs/Camera.prefab +++ b/Assets/Prefabs/Camera.prefab @@ -36,7 +36,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1683038502340488} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -29.571674, y: 14.972714, z: -1} + m_LocalPosition: {x: -4.568595, y: 35.28643, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Prefabs/Chain Link.prefab b/Assets/Prefabs/Chain Link.prefab index 460a6b9..075e1d9 100644 --- a/Assets/Prefabs/Chain Link.prefab +++ b/Assets/Prefabs/Chain Link.prefab @@ -36,7 +36,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1662540403241760} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 9.955, y: 115.41818, z: -0.07543945} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -53,7 +53,7 @@ Rigidbody2D: m_Simulated: 1 m_UseFullKinematicContacts: 0 m_UseAutoMass: 0 - m_Mass: 1 + m_Mass: 0.001 m_LinearDrag: 0 m_AngularDrag: 0.05 m_GravityScale: 1 @@ -116,7 +116,7 @@ HingeJoint2D: m_GameObject: {fileID: 1662540403241760} m_Enabled: 1 serializedVersion: 4 - m_EnableCollision: 0 + m_EnableCollision: 1 m_ConnectedRigidBody: {fileID: 0} m_BreakForce: Infinity m_BreakTorque: Infinity diff --git a/Assets/Prefabs/ChainAuto.prefab b/Assets/Prefabs/ChainAuto.prefab index 4dfa6f2..ec069f9 100644 --- a/Assets/Prefabs/ChainAuto.prefab +++ b/Assets/Prefabs/ChainAuto.prefab @@ -34,7 +34,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1244978095539468} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.3629713, y: 38.1587, z: 0.18701172} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Prefabs/Fish.prefab b/Assets/Prefabs/Fish.prefab new file mode 100644 index 0000000..0b5e5d0 --- /dev/null +++ b/Assets/Prefabs/Fish.prefab @@ -0,0 +1,107 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 0} + m_RootGameObject: {fileID: 1615301965237016} + m_IsPrefabAsset: 1 +--- !u!1 &1615301965237016 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 6 + m_Component: + - component: {fileID: 4139569998151354} + - component: {fileID: 95068346191508518} + - component: {fileID: 212894136892818758} + m_Layer: 0 + m_Name: Fish + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4139569998151354 +Transform: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1615301965237016} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -12.660833, y: 34.92962, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &95068346191508518 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1615301965237016} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: bad0282c8547e9444b3d82126cb74259, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!212 &212894136892818758 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1615301965237016} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + 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_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 5196555e6d71c154a926591247bbc9ae, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.62, y: 0.38} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/Prefabs/_Fish_.prefab.meta b/Assets/Prefabs/Fish.prefab.meta similarity index 100% rename from Assets/Prefabs/_Fish_.prefab.meta rename to Assets/Prefabs/Fish.prefab.meta diff --git a/Assets/Prefabs/Harpoon.prefab b/Assets/Prefabs/Harpoon.prefab index ebe866c..2244a08 100644 --- a/Assets/Prefabs/Harpoon.prefab +++ b/Assets/Prefabs/Harpoon.prefab @@ -36,7 +36,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1172082933451472} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 7.5735884, y: 76.737595, z: -0.07543945} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -53,7 +53,7 @@ Rigidbody2D: m_Simulated: 1 m_UseFullKinematicContacts: 0 m_UseAutoMass: 0 - m_Mass: 10 + m_Mass: 0.1 m_LinearDrag: 0 m_AngularDrag: 0.05 m_GravityScale: 1 @@ -127,7 +127,7 @@ HingeJoint2D: m_Motor: m_MotorSpeed: 0 m_MaximumMotorForce: 10000 - m_UseLimits: 0 + m_UseLimits: 1 m_AngleLimits: - m_LowerAngle: 0 - m_UpperAngle: 359 + m_LowerAngle: -70 + m_UpperAngle: 250 diff --git a/Assets/Prefabs/Ship.prefab b/Assets/Prefabs/Ship.prefab index ea97290..edd8349 100644 --- a/Assets/Prefabs/Ship.prefab +++ b/Assets/Prefabs/Ship.prefab @@ -11,6 +11,22 @@ Prefab: m_SourcePrefab: {fileID: 0} m_RootGameObject: {fileID: 1506768218425990} m_IsPrefabAsset: 1 +--- !u!1 &1153545951897974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 6 + m_Component: + - component: {fileID: 4967707696773828} + - component: {fileID: 114498127896577538} + m_Layer: 0 + m_Name: ChainAuto + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 --- !u!1 &1396569450907664 GameObject: m_ObjectHideFlags: 0 @@ -66,10 +82,11 @@ Transform: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1506768218425990} - m_LocalRotation: {x: 0, y: 0, z: 0.42749164, w: -0.9040193} - m_LocalPosition: {x: -29.571674, y: 14.972714, z: 0} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -3.37, y: 50.53, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 4967707696773828} - {fileID: 4419769467158982} - {fileID: 4811992088834386} m_Father: {fileID: 0} @@ -83,10 +100,10 @@ Transform: m_GameObject: {fileID: 1396569450907664} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.245, y: -0.382, z: 0} - m_LocalScale: {x: 1.4615, y: 1.4615, z: 1.4615} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4279439219186522} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4811992088834386 Transform: @@ -99,7 +116,20 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4279439219186522} - m_RootOrder: 1 + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4967707696773828 +Transform: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1153545951897974} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.163, y: 0.114, z: 0.18701172} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4279439219186522} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!50 &50107883579770240 Rigidbody2D: @@ -120,7 +150,7 @@ Rigidbody2D: m_Interpolate: 0 m_SleepingMode: 1 m_CollisionDetection: 0 - m_Constraints: 0 + m_Constraints: 3 --- !u!60 &60759684842668732 PolygonCollider2D: m_ObjectHideFlags: 1 @@ -149,6 +179,22 @@ PolygonCollider2D: - {x: 0.78310096, y: -0.51465136} - {x: 1.3078427, y: 0.32390344} - {x: -1.2722943, y: 0.3283955} +--- !u!114 &114498127896577538 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1153545951897974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 19e8f1cd3ef695e499687d78824c32e7, type: 3} + m_Name: + m_EditorClassIdentifier: + chain: {fileID: 1662540403241760, guid: 0ccfd55ddf6d29547b1e9de873bca75d, type: 2} + tail: {fileID: 1172082933451472, guid: 288f16ae5eaa16440b89da431723b1c2, type: 2} + chainOffset: {x: 0, y: -0.18, z: 0} + tailOffset: {x: -0.08, y: -0.85, z: 0} + chainNumber: 50 --- !u!114 &114893472868460232 MonoBehaviour: m_ObjectHideFlags: 1 @@ -160,7 +206,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 91d88e1722c056f47a710df9123b44a9, type: 3} m_Name: m_EditorClassIdentifier: - rb: {fileID: 50107883579770240} + hull: {fileID: 1396569450907664} horizontalShipSpeed: 10 verticalShipSpeed: 18 --- !u!212 &212928515413584804 diff --git a/Assets/Prefabs/_Fish_.prefab b/Assets/Prefabs/_Fish_.prefab deleted file mode 100644 index a5539fa..0000000 --- a/Assets/Prefabs/_Fish_.prefab +++ /dev/null @@ -1,41 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 0} - m_RootGameObject: {fileID: 1615301965237016} - m_IsPrefabAsset: 1 ---- !u!1 &1615301965237016 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 6 - m_Component: - - component: {fileID: 4139569998151354} - m_Layer: 0 - m_Name: _Fish_ - m_TagString: Untagged - m_Icon: {fileID: 2974397684917235467, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4139569998151354 -Transform: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1615301965237016} - 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: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 459ebb0..4af9780 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -127,11 +127,11 @@ Prefab: m_Modifications: - target: {fileID: 4279439219186522, guid: 1cf703958a669d942a42326499701367, type: 2} propertyPath: m_LocalPosition.x - value: -4.126 + value: -3.37 objectReference: {fileID: 0} - target: {fileID: 4279439219186522, guid: 1cf703958a669d942a42326499701367, type: 2} propertyPath: m_LocalPosition.y - value: 36.531 + value: 50.53 objectReference: {fileID: 0} - target: {fileID: 4279439219186522, guid: 1cf703958a669d942a42326499701367, type: 2} propertyPath: m_LocalPosition.z @@ -157,6 +157,31 @@ Prefab: propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} + - target: {fileID: 4419769467158982, guid: 1cf703958a669d942a42326499701367, type: 2} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4419769467158982, guid: 1cf703958a669d942a42326499701367, type: 2} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4419769467158982, guid: 1cf703958a669d942a42326499701367, type: 2} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4967707696773828, guid: 1cf703958a669d942a42326499701367, type: 2} + propertyPath: m_LocalPosition.x + value: 0.163 + objectReference: {fileID: 0} + - target: {fileID: 4967707696773828, guid: 1cf703958a669d942a42326499701367, type: 2} + propertyPath: m_LocalPosition.y + value: 0.114 + objectReference: {fileID: 0} + - target: {fileID: 50107883579770240, guid: 1cf703958a669d942a42326499701367, + type: 2} + propertyPath: m_Constraints + value: 3 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1cf703958a669d942a42326499701367, type: 2} m_IsPrefabAsset: 0 @@ -209,6 +234,16 @@ Prefab: propertyPath: orthographic size value: 11 objectReference: {fileID: 0} + - target: {fileID: 20610604938940038, guid: acb6270a21e7fa744878210a4df90d27, + type: 2} + propertyPath: m_projectionMatrixMode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 20610604938940038, guid: acb6270a21e7fa744878210a4df90d27, + type: 2} + propertyPath: field of view + value: 150 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: acb6270a21e7fa744878210a4df90d27, type: 2} m_IsPrefabAsset: 0 diff --git a/Assets/Scripts/ChainLinker.cs b/Assets/Scripts/ChainLinker.cs index 13d34dd..01bb2bb 100644 --- a/Assets/Scripts/ChainLinker.cs +++ b/Assets/Scripts/ChainLinker.cs @@ -11,16 +11,40 @@ public class ChainLinker : MonoBehaviour { public int chainNumber; void Start () { - GameObject tailInstance = Instantiate(tail, transform); - GameObject nextChain = Instantiate(chain, transform); - nextChain.transform.position = tailInstance.transform.position + tailOffset; - tailInstance.GetComponent().connectedBody = nextChain.GetComponent(); + GameObject lastChain = null; + GameObject nextChain = null; + for(int i = 0; i < chainNumber - 1; i++) { - GameObject lastChain = nextChain; - nextChain = Instantiate(chain, transform); - nextChain.transform.position = lastChain.transform.position + chainOffset; - lastChain.GetComponent().connectedBody = nextChain.GetComponent(); + if (i > 0) + { + lastChain = nextChain; + } + if (i == chainNumber - 2) + { + nextChain = Instantiate(tail, transform); + nextChain.transform.position = lastChain.transform.position + tailOffset; + } + else + { + nextChain = Instantiate(chain, transform); + if (lastChain != null) + { + nextChain.transform.position = lastChain.transform.position + chainOffset; + } + else + { + nextChain.transform.position = transform.position; + } + } + if (lastChain != null) + { + nextChain.GetComponent().connectedBody = lastChain.GetComponent(); + } + else + { + nextChain.GetComponent().connectedBody = GetComponentInParent(); + } } } } diff --git a/Assets/Scripts/FishSpawner.cs b/Assets/Scripts/FishSpawner.cs index 9ed3ae4..4857297 100644 --- a/Assets/Scripts/FishSpawner.cs +++ b/Assets/Scripts/FishSpawner.cs @@ -17,7 +17,8 @@ public class FishSpawner : MonoBehaviour { timeToSpawn -= Time.deltaTime; if(timeToSpawn <= 0) { - Instantiate(fish); + GameObject newFish = Instantiate(fish); + newFish.transform.position = transform.position; timeToSpawn = Random.Range(spawnTime - randomFactor, spawnTime + randomFactor); } } diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 80a6833..5af30ca 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -4,7 +4,8 @@ using UnityEngine; public class PlayerMovement : MonoBehaviour { - public Rigidbody2D rb; + private Rigidbody2D rb; + public GameObject hull; public float horizontalShipSpeed = 50; public float verticalShipSpeed = 20; @@ -15,31 +16,17 @@ public class PlayerMovement : MonoBehaviour { void FixedUpdate () { if (Input.GetKey(KeyCode.LeftArrow)) { - transform.localScale = new Vector3(-1, 1, 1); - if(Input.GetKey(KeyCode.RightShift)) - { - rb.AddTorque(horizontalShipSpeed); - } - else - { - rb.AddForce(Vector2.right * -horizontalShipSpeed); - } + hull.transform.localScale = new Vector3(-1, 1, 1); + rb.AddForce(Vector2.right * -horizontalShipSpeed); } if (Input.GetKey(KeyCode.RightArrow)) { - transform.localScale = new Vector3(1, 1, 1); - if (Input.GetKey(KeyCode.RightShift)) - { - rb.AddTorque(-horizontalShipSpeed); - } - else - { - rb.AddForce(Vector2.right * horizontalShipSpeed); - } + hull.transform.localScale = new Vector3(1, 1, 1); + rb.AddForce(Vector2.right * horizontalShipSpeed); } if (Input.GetKey(KeyCode.UpArrow)) { - rb.AddForce(transform.up * verticalShipSpeed); + rb.AddForce(Vector2.up * verticalShipSpeed); } } } diff --git a/Assets/Scripts/RampinoTester.cs b/Assets/Scripts/RampinoTester.cs new file mode 100644 index 0000000..1b2c73d --- /dev/null +++ b/Assets/Scripts/RampinoTester.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RampinoTester : MonoBehaviour +{ + + public Rigidbody2D rb; + + void Start() + { + rb = GetComponent(); + } + + void Update() + { + if (Input.GetKey(KeyCode.Space)) + { + rb.AddForce(Vector2.up * 20f); + } + } +} diff --git a/Assets/Scripts/RampinoTester.cs.meta b/Assets/Scripts/RampinoTester.cs.meta new file mode 100644 index 0000000..37385b0 --- /dev/null +++ b/Assets/Scripts/RampinoTester.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 710b122dd43e80a4e9a381e370a91d3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/ChainLink.png b/Assets/Sprites/ChainLink.png index 9fa3f0f..556849d 100644 --- a/Assets/Sprites/ChainLink.png +++ b/Assets/Sprites/ChainLink.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f36b76763a26866dc1a0bea01e494370d3f38ceb7b2d99d3f9db0e338308c312 -size 7727 +oid sha256:0fd98345b6d0e9288ec135d859524e21db61c23505e1af272b010c4d6cb8f1f6 +size 1363 diff --git a/Assets/Sprites/ChainLink.png.meta b/Assets/Sprites/ChainLink.png.meta index 8d82b3b..efd47a1 100644 --- a/Assets/Sprites/ChainLink.png.meta +++ b/Assets/Sprites/ChainLink.png.meta @@ -31,12 +31,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 + filterMode: 0 aniso: -1 mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: 1 + wrapU: 0 + wrapV: 0 + wrapW: 0 nPOTScale: 0 lightmap: 0 compressionQuality: 50 @@ -44,9 +44,9 @@ TextureImporter: spriteExtrude: 1 spriteMeshType: 1 alignment: 0 - spritePivot: {x: 0.42222226, y: 0.9975308} + spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 50 - spriteBorder: {x: 0, y: 0, z: 1, w: 0} + spriteBorder: {x: 0, y: 0, z: 0, w: 1} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 1 diff --git a/Assets/Sprites/Fish1.png b/Assets/Sprites/Fish1.png new file mode 100644 index 0000000..3547543 --- /dev/null +++ b/Assets/Sprites/Fish1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3db5d9a21dfb89d1be6faff7b951093f1ed500a0fca747884203fc530e1528cd +size 15970 diff --git a/Assets/Sprites/pesce1.png.meta b/Assets/Sprites/Fish1.png.meta similarity index 69% rename from Assets/Sprites/pesce1.png.meta rename to Assets/Sprites/Fish1.png.meta index df7397e..b0aeda1 100644 --- a/Assets/Sprites/pesce1.png.meta +++ b/Assets/Sprites/Fish1.png.meta @@ -45,7 +45,7 @@ TextureImporter: spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 + spritePixelsToUnits: 50 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 @@ -69,6 +69,39 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/Assets/Sprites/Fish2.png b/Assets/Sprites/Fish2.png new file mode 100644 index 0000000..8accb04 --- /dev/null +++ b/Assets/Sprites/Fish2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f6b4268d54c23646aa8e78277f584519f5d18d69413569ad6fce79328cf77ab +size 15522 diff --git a/Assets/Sprites/pesce2.png.meta b/Assets/Sprites/Fish2.png.meta similarity index 69% rename from Assets/Sprites/pesce2.png.meta rename to Assets/Sprites/Fish2.png.meta index 56aa549..5efff85 100644 --- a/Assets/Sprites/pesce2.png.meta +++ b/Assets/Sprites/Fish2.png.meta @@ -45,7 +45,7 @@ TextureImporter: spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 + spritePixelsToUnits: 50 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 @@ -69,6 +69,39 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/Assets/Sprites/pesce1.png b/Assets/Sprites/pesce1.png deleted file mode 100644 index 38704d1..0000000 --- a/Assets/Sprites/pesce1.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be2c97d0e0394afd4858780880dfea761841e6eb44be289258939a1ccc017abf -size 19786 diff --git a/Assets/Sprites/pesce2.png b/Assets/Sprites/pesce2.png deleted file mode 100644 index c0a764a..0000000 --- a/Assets/Sprites/pesce2.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f4a09e6d53ca9bc23b88e529d8e3f4d0f9aa9c7be30dc96cbb00034dcca19aee -size 19754