From 16222c7cab0e74ea876b945d6692f4f39c62dcbe Mon Sep 17 00:00:00 2001 From: Martynas Antipenkovas Date: Fri, 31 Jan 2020 22:09:14 +0000 Subject: [PATCH] Picking up --- .vs/ProjectSettings.json | 3 + .vs/VSWorkspaceState.json | 10 + Fixing/Assets/DaPidgeyDeon/Pidgeon.blend.meta | 5 +- Fixing/Assets/FBX/AlarmClock.FBX.meta | 98 ++++ Fixing/Assets/FBX/Lamp.FBX.meta | 95 ++++ Fixing/Assets/Prefabs.meta | 8 + Fixing/Assets/Prefabs/Player.prefab | 427 ++++++++++++++++ Fixing/Assets/Prefabs/Player.prefab.meta | 7 + Fixing/Assets/Scenes/Martins scene.unity | 483 ++++++++++++++++++ Fixing/Assets/Scenes/Martins scene.unity.meta | 7 + Fixing/Assets/Scripts.meta | 8 + Fixing/Assets/Scripts/FixingObject.cs | 11 + Fixing/Assets/Scripts/FixingObject.cs.meta | 11 + Fixing/Assets/Scripts/FixingPoint.cs | 45 ++ Fixing/Assets/Scripts/FixingPoint.cs.meta | 11 + Fixing/Assets/Scripts/PickableObject.cs | 20 + Fixing/Assets/Scripts/PickableObject.cs.meta | 11 + Fixing/Assets/Scripts/PickingUpMechanism.cs | 54 ++ .../Assets/Scripts/PickingUpMechanism.cs.meta | 11 + .../ProjectSettings/EditorBuildSettings.asset | 5 +- Fixing/ProjectSettings/GraphicsSettings.asset | 4 + Fixing/ProjectSettings/InputManager.asset | 38 +- Fixing/ProjectSettings/TagManager.asset | 4 +- .../UnityConnectSettings.asset | 2 +- 24 files changed, 1371 insertions(+), 7 deletions(-) create mode 100644 .vs/ProjectSettings.json create mode 100644 .vs/VSWorkspaceState.json create mode 100644 Fixing/Assets/FBX/AlarmClock.FBX.meta create mode 100644 Fixing/Assets/FBX/Lamp.FBX.meta create mode 100644 Fixing/Assets/Prefabs.meta create mode 100644 Fixing/Assets/Prefabs/Player.prefab create mode 100644 Fixing/Assets/Prefabs/Player.prefab.meta create mode 100644 Fixing/Assets/Scenes/Martins scene.unity create mode 100644 Fixing/Assets/Scenes/Martins scene.unity.meta create mode 100644 Fixing/Assets/Scripts.meta create mode 100644 Fixing/Assets/Scripts/FixingObject.cs create mode 100644 Fixing/Assets/Scripts/FixingObject.cs.meta create mode 100644 Fixing/Assets/Scripts/FixingPoint.cs create mode 100644 Fixing/Assets/Scripts/FixingPoint.cs.meta create mode 100644 Fixing/Assets/Scripts/PickableObject.cs create mode 100644 Fixing/Assets/Scripts/PickableObject.cs.meta create mode 100644 Fixing/Assets/Scripts/PickingUpMechanism.cs create mode 100644 Fixing/Assets/Scripts/PickingUpMechanism.cs.meta diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..0cf5ea5 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": "No Configurations" +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..4b77729 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,10 @@ +{ + "ExpandedNodes": [ + "", + "\\Fixing", + "\\Fixing\\Assets", + "\\Fixing\\Assets\\Scripts" + ], + "SelectedNode": "\\Fixing\\Assets\\Scripts\\PickableObject.cs", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/Fixing/Assets/DaPidgeyDeon/Pidgeon.blend.meta b/Fixing/Assets/DaPidgeyDeon/Pidgeon.blend.meta index d81fb76..d3579ba 100644 --- a/Fixing/Assets/DaPidgeyDeon/Pidgeon.blend.meta +++ b/Fixing/Assets/DaPidgeyDeon/Pidgeon.blend.meta @@ -2,7 +2,10 @@ fileFormatVersion: 2 guid: 37bf4122b2c6eb04ca77c02c6195cd1b ModelImporter: serializedVersion: 26 - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 74: -623603649343465320 + second: Scene externalObjects: {} materials: importMaterials: 1 diff --git a/Fixing/Assets/FBX/AlarmClock.FBX.meta b/Fixing/Assets/FBX/AlarmClock.FBX.meta new file mode 100644 index 0000000..794cf6b --- /dev/null +++ b/Fixing/Assets/FBX/AlarmClock.FBX.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 405d150cf9ec80241ba98f48a48ba1a4 +ModelImporter: + serializedVersion: 26 + internalIDToNameTable: + - first: + 74: 1827226128182048838 + second: Take 001 + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/FBX/Lamp.FBX.meta b/Fixing/Assets/FBX/Lamp.FBX.meta new file mode 100644 index 0000000..c5f7242 --- /dev/null +++ b/Fixing/Assets/FBX/Lamp.FBX.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: eade7d2fc5dca8146bd782cf4e205a2a +ModelImporter: + serializedVersion: 26 + internalIDToNameTable: [] + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Prefabs.meta b/Fixing/Assets/Prefabs.meta new file mode 100644 index 0000000..74e29f1 --- /dev/null +++ b/Fixing/Assets/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b1896b88da30d54180831648f775b75 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Prefabs/Player.prefab b/Fixing/Assets/Prefabs/Player.prefab new file mode 100644 index 0000000..54e380a --- /dev/null +++ b/Fixing/Assets/Prefabs/Player.prefab @@ -0,0 +1,427 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4844291388511567457 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8578142087225520896} + m_Layer: 0 + m_Name: HoldPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8578142087225520896 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4844291388511567457} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.63, z: 1.46} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7123611625215396745} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7123611625215039401 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7123611625215396745} + - component: {fileID: 7123611625215890827} + - component: {fileID: 7123611625213594027} + - component: {fileID: 7123611625209645037} + m_Layer: 0 + m_Name: FirstPersonCharacter + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7123611625215396745 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039401} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.8, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8578142087225520896} + m_Father: {fileID: 7123611625215396747} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &7123611625215890827 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039401} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &7123611625213594027 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039401} + m_Enabled: 1 +--- !u!124 &7123611625209645037 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039401} + m_Enabled: 1 +--- !u!1 &7123611625215039403 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7123611625215396747} + - component: {fileID: 7123611625203081835} + - component: {fileID: 7123611625208504907} + - component: {fileID: 7123611625212015819} + - component: {fileID: 7123611625213759051} + - component: {fileID: 1241802337626069024} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7123611625215396747 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039403} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.633, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7123611625215396745} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!143 &7123611625203081835 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039403} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 1.8 + m_Radius: 0.5 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &7123611625208504907 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039403} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 05ec5cf00ca181d45a42ba1870e148c3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsWalking: 0 + m_WalkSpeed: 5 + m_RunSpeed: 10 + m_RunstepLenghten: 0.7 + m_JumpSpeed: 10 + m_StickToGroundForce: 10 + m_GravityMultiplier: 2 + m_MouseLook: + XSensitivity: 2 + YSensitivity: 2 + clampVerticalRotation: 1 + MinimumX: -90 + MaximumX: 90 + smooth: 0 + smoothTime: 5 + lockCursor: 1 + m_UseFovKick: 1 + m_FovKick: + Camera: {fileID: 0} + originalFov: 0 + FOVIncrease: 3 + TimeToIncrease: 1 + TimeToDecrease: 1 + IncreaseCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_UseHeadBob: 1 + m_HeadBob: + HorizontalBobRange: 0.1 + VerticalBobRange: 0.1 + Bobcurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + VerticaltoHorizontalRatio: 2 + m_JumpBob: + BobDuration: 0.2 + BobAmount: 0.1 + m_StepInterval: 5 + m_FootstepSounds: + - {fileID: 8300000, guid: 42e65e088b3f4374e851b8dbd38f3df9, type: 3} + - {fileID: 8300000, guid: 8bc94ec6ed537e743b481638bdcd503d, type: 3} + m_JumpSound: {fileID: 8300000, guid: 5897aeed9b676024fbb8c694b421a861, type: 3} + m_LandSound: {fileID: 8300000, guid: 3b09d59f4499d45428baa7a21e954296, type: 3} +--- !u!54 &7123611625212015819 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039403} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!82 &7123611625213759051 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039403} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!114 &1241802337626069024 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7123611625215039403} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8c3bc760857c1e846afd82e991716da8, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Fixing/Assets/Prefabs/Player.prefab.meta b/Fixing/Assets/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..0781372 --- /dev/null +++ b/Fixing/Assets/Prefabs/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 03f8eef1e87942c438c6d2a90e50d7d3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Scenes/Martins scene.unity b/Fixing/Assets/Scenes/Martins scene.unity new file mode 100644 index 0000000..d3d1cfa --- /dev/null +++ b/Fixing/Assets/Scenes/Martins scene.unity @@ -0,0 +1,483 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &370664298 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 370664302} + - component: {fileID: 370664301} + - component: {fileID: 370664300} + - component: {fileID: 370664299} + - component: {fileID: 370664303} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Pickable + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &370664299 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370664298} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &370664300 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370664298} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &370664301 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370664298} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &370664302 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370664298} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.58709335, y: 1.2328026, z: -0.15497255} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &370664303 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370664298} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &1311488766 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1311488768} + - component: {fileID: 1311488767} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1311488767 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311488766} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1311488768 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311488766} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1986439308 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1986439312} + - component: {fileID: 1986439311} + - component: {fileID: 1986439310} + - component: {fileID: 1986439309} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1986439309 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986439308} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1986439310 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986439308} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1986439311 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986439308} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1986439312 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986439308} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 20, y: 1, z: 20} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &4775238573218611967 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7123611625215039403, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_Name + value: Player + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.633 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7123611625215396747, guid: 03f8eef1e87942c438c6d2a90e50d7d3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 03f8eef1e87942c438c6d2a90e50d7d3, type: 3} diff --git a/Fixing/Assets/Scenes/Martins scene.unity.meta b/Fixing/Assets/Scenes/Martins scene.unity.meta new file mode 100644 index 0000000..086dae7 --- /dev/null +++ b/Fixing/Assets/Scenes/Martins scene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e101cf88b1b2d5f428efac21b1eb4f76 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Scripts.meta b/Fixing/Assets/Scripts.meta new file mode 100644 index 0000000..a5525c0 --- /dev/null +++ b/Fixing/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 49b527d16a0f37a4d9e1c7a9ed61a1d8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Scripts/FixingObject.cs b/Fixing/Assets/Scripts/FixingObject.cs new file mode 100644 index 0000000..8f4789c --- /dev/null +++ b/Fixing/Assets/Scripts/FixingObject.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class FixingObject : MonoBehaviour +{ + + public FixingType fixingType; + + +} diff --git a/Fixing/Assets/Scripts/FixingObject.cs.meta b/Fixing/Assets/Scripts/FixingObject.cs.meta new file mode 100644 index 0000000..ed39b4a --- /dev/null +++ b/Fixing/Assets/Scripts/FixingObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b1f0c268be438c409ed83ed7faddc38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Scripts/FixingPoint.cs b/Fixing/Assets/Scripts/FixingPoint.cs new file mode 100644 index 0000000..71844ee --- /dev/null +++ b/Fixing/Assets/Scripts/FixingPoint.cs @@ -0,0 +1,45 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public enum FixingType { SmallHole, BigHole } + +public class FixingPoint : MonoBehaviour +{ + + public bool IsFixed { get; private set; } + + public FixingType fixingType; + + private GameObject fixingPoint; + + private const string FIXING_POINT_TAG_NAME = "FixingPoint"; + + private void Start() + { + fixingPoint = GetComponentsInChildren().Where(x => x.CompareTag(FIXING_POINT_TAG_NAME)).FirstOrDefault().gameObject; + IsFixed = false; + } + + public void FixIt(GameObject prop) + { + + FixingObject fixingPart = prop.GetComponent(); + + if (fixingPart.fixingType.Equals(fixingType)) + { + prop.transform.SetParent(fixingPoint.transform); + IsFixed = true; + + + //might need to do some angle shit here + } + + else + { + //might do some UI things + } + + } +} diff --git a/Fixing/Assets/Scripts/FixingPoint.cs.meta b/Fixing/Assets/Scripts/FixingPoint.cs.meta new file mode 100644 index 0000000..b38edf0 --- /dev/null +++ b/Fixing/Assets/Scripts/FixingPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8cb665acc56c8543ac4029591f2119c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Scripts/PickableObject.cs b/Fixing/Assets/Scripts/PickableObject.cs new file mode 100644 index 0000000..f43e88b --- /dev/null +++ b/Fixing/Assets/Scripts/PickableObject.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PickableObject : MonoBehaviour +{ + private Vector3 origin; + + private void Start() + { + origin = transform.position; + } + + + public void Reset() + { + transform.position = origin; + } + +} diff --git a/Fixing/Assets/Scripts/PickableObject.cs.meta b/Fixing/Assets/Scripts/PickableObject.cs.meta new file mode 100644 index 0000000..9070e48 --- /dev/null +++ b/Fixing/Assets/Scripts/PickableObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e36c31bc0bc61d440a831e47199fd28f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/Assets/Scripts/PickingUpMechanism.cs b/Fixing/Assets/Scripts/PickingUpMechanism.cs new file mode 100644 index 0000000..1212ef3 --- /dev/null +++ b/Fixing/Assets/Scripts/PickingUpMechanism.cs @@ -0,0 +1,54 @@ +using System.Linq; +using UnityEngine; + +public class PickingUpMechanism : MonoBehaviour +{ + private GameObject holdPlace; + + private GameObject heldObject; + + private const string PICKABLE_ITEM_TAG_NAME = "Pickable"; + + private const float DISTANCE_TO_CHECK_ITEM_FOR = 20f; + + void Start() + { + holdPlace = GetComponentsInChildren().Where(x => x.transform.name == "HoldPosition").FirstOrDefault().gameObject; + } + + void Update() + { + if (Input.GetButtonDown("Fire1") && heldObject == null) + { + RaycastHit hit; + //pick an object + if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out hit, DISTANCE_TO_CHECK_ITEM_FOR)) + { + if (hit.transform.CompareTag(PICKABLE_ITEM_TAG_NAME)) + { + heldObject = hit.transform.gameObject; + heldObject.transform.SetParent(holdPlace.transform); + + //dissable all the colliders thay could break stuff + heldObject.GetComponentsInChildren(true).ToList().ForEach(x => x.enabled = false); + Rigidbody rb = heldObject.GetComponentInChildren(); + rb.useGravity = false; + rb.velocity = Vector3.zero; + rb.angularVelocity = Vector3.zero; + + } + } + } + + //drop the object + else if (Input.GetButtonDown("Fire1") + && heldObject != null) //if it has something + { + heldObject.transform.SetParent(null); + //reanable colliders + heldObject.GetComponentsInChildren(true).ToList().ForEach(x => x.enabled = true); + heldObject.GetComponentInChildren(true).useGravity = true; + heldObject = null; + } + } +} diff --git a/Fixing/Assets/Scripts/PickingUpMechanism.cs.meta b/Fixing/Assets/Scripts/PickingUpMechanism.cs.meta new file mode 100644 index 0000000..ef33df8 --- /dev/null +++ b/Fixing/Assets/Scripts/PickingUpMechanism.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c3bc760857c1e846afd82e991716da8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fixing/ProjectSettings/EditorBuildSettings.asset b/Fixing/ProjectSettings/EditorBuildSettings.asset index 0147887..be9bdaf 100644 --- a/Fixing/ProjectSettings/EditorBuildSettings.asset +++ b/Fixing/ProjectSettings/EditorBuildSettings.asset @@ -4,5 +4,8 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 - m_Scenes: [] + m_Scenes: + - enabled: 1 + path: Assets/Scenes/Martins scene.unity + guid: e101cf88b1b2d5f428efac21b1eb4f76 m_configObjects: {} diff --git a/Fixing/ProjectSettings/GraphicsSettings.asset b/Fixing/ProjectSettings/GraphicsSettings.asset index 74d7b53..094afdf 100644 --- a/Fixing/ProjectSettings/GraphicsSettings.asset +++ b/Fixing/ProjectSettings/GraphicsSettings.asset @@ -35,6 +35,9 @@ GraphicsSettings: - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} @@ -59,3 +62,4 @@ GraphicsSettings: m_AlbedoSwatchInfos: [] m_LightsUseLinearIntensity: 0 m_LightsUseColorTemperature: 0 + m_LogWhenShaderIsCompiled: 0 diff --git a/Fixing/ProjectSettings/InputManager.asset b/Fixing/ProjectSettings/InputManager.asset index 17c8f53..7ac104d 100644 --- a/Fixing/ProjectSettings/InputManager.asset +++ b/Fixing/ProjectSettings/InputManager.asset @@ -42,7 +42,7 @@ InputManager: descriptiveName: descriptiveNegativeName: negativeButton: - positiveButton: left ctrl + positiveButton: altNegativeButton: altPositiveButton: mouse 0 gravity: 1000 @@ -58,7 +58,7 @@ InputManager: descriptiveName: descriptiveNegativeName: negativeButton: - positiveButton: left alt + positiveButton: altNegativeButton: altPositiveButton: mouse 1 gravity: 1000 @@ -74,7 +74,7 @@ InputManager: descriptiveName: descriptiveNegativeName: negativeButton: - positiveButton: left shift + positiveButton: altNegativeButton: altPositiveButton: mouse 2 gravity: 1000 @@ -293,3 +293,35 @@ InputManager: type: 0 axis: 0 joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: 0 + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 0 + axis: 1 + joyNum: 0 diff --git a/Fixing/ProjectSettings/TagManager.asset b/Fixing/ProjectSettings/TagManager.asset index 1c92a78..833999a 100644 --- a/Fixing/ProjectSettings/TagManager.asset +++ b/Fixing/ProjectSettings/TagManager.asset @@ -3,7 +3,9 @@ --- !u!78 &1 TagManager: serializedVersion: 2 - tags: [] + tags: + - Pickable + - FixingPoint layers: - Default - TransparentFX diff --git a/Fixing/ProjectSettings/UnityConnectSettings.asset b/Fixing/ProjectSettings/UnityConnectSettings.asset index fa0b146..c3ae9a0 100644 --- a/Fixing/ProjectSettings/UnityConnectSettings.asset +++ b/Fixing/ProjectSettings/UnityConnectSettings.asset @@ -4,7 +4,7 @@ UnityConnectSettings: m_ObjectHideFlags: 0 serializedVersion: 1 - m_Enabled: 0 + m_Enabled: 1 m_TestMode: 0 m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events m_EventUrl: https://cdp.cloud.unity3d.com/v1/events