diff --git a/AGENTS.md b/AGENTS.md index b2b7561..5f212ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ - Project name: HeadlessHazard - Unity version: Unity 6000.3.10f1 - Active game object: - - Name: GroundCheck + - Name: Plate - Tag: Untagged - - Layer: Default + - Layer: Ground \ No newline at end of file diff --git a/Assets/Art/Materials/Player/Trajectory Material.mat b/Assets/Art/Materials/Player/Trajectory Material.mat new file mode 100644 index 0000000..ebe306a --- /dev/null +++ b/Assets/Art/Materials/Player/Trajectory Material.mat @@ -0,0 +1,141 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4017841189937380044 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Trajectory Material + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _SPECULAR_SETUP + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - MOTIONVECTORS + - DepthOnly + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _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} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _WorkflowMode: 0 + - _XRMotionVectorsPass: 1 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 0, b: 0, a: 0.6862745} + - _Color: {r: 1, g: 0, b: 0, a: 0.6862745} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Art/Materials/Player/Trajectory Material.mat.meta b/Assets/Art/Materials/Player/Trajectory Material.mat.meta new file mode 100644 index 0000000..25e9f87 --- /dev/null +++ b/Assets/Art/Materials/Player/Trajectory Material.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51588d9f6325eb54eaa0c67389672860 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Code/Scripts/Player/InputSystem_Actions.inputactions b/Assets/Code/Scripts/Player/InputSystem_Actions.inputactions index 281c84e..a225487 100644 --- a/Assets/Code/Scripts/Player/InputSystem_Actions.inputactions +++ b/Assets/Code/Scripts/Player/InputSystem_Actions.inputactions @@ -25,7 +25,7 @@ "initialStateCheck": true }, { - "name": "Pickup", + "name": "HeadInteract", "type": "Button", "id": "5a0c555a-8fc4-4188-9eed-401eb8f017b5", "expectedControlType": "", @@ -519,7 +519,7 @@ "interactions": "", "processors": "", "groups": ";Keyboard&Mouse", - "action": "Pickup", + "action": "HeadInteract", "isComposite": false, "isPartOfComposite": false }, diff --git a/Assets/Code/Scripts/Player/PlayerHeadControll.cs b/Assets/Code/Scripts/Player/PlayerHeadControll.cs index 78618df..3605766 100644 --- a/Assets/Code/Scripts/Player/PlayerHeadControll.cs +++ b/Assets/Code/Scripts/Player/PlayerHeadControll.cs @@ -1,3 +1,4 @@ +using System.Runtime.CompilerServices; using UnityEngine; public class PlayerHeadController : MonoBehaviour @@ -34,22 +35,27 @@ public class PlayerHeadController : MonoBehaviour void Update() { + if (input.HeadInteractionPressed) + { + InteractHead(); + } + if (input.ThrowPressed) { ThrowHead(); } - - if (input.PickupPressed) - { - TryPickupHead(); - } } - private void ThrowHead() + private void InteractHead() { if (!isHoldingHead) - return; + TryPickupHead(); + else + DropHead(); + } + private void DropHead() + { animator.SetTrigger("Throw"); isHoldingHead = false; @@ -63,6 +69,14 @@ public class PlayerHeadController : MonoBehaviour RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationY; + } + + private void ThrowHead() + { + if (!isHoldingHead) + return; + + DropHead(); m_headRigidbody.AddForce(CameraTransform.forward * ThrowForce, ForceMode.Impulse); } @@ -94,4 +108,4 @@ public class PlayerHeadController : MonoBehaviour Head.localPosition = m_headInitialLocalPos; Head.localRotation = m_headInitialLocalRot; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/Assets/Code/Scripts/Player/PlayerInputHandler.cs b/Assets/Code/Scripts/Player/PlayerInputHandler.cs index ef03dce..c8bd42d 100644 --- a/Assets/Code/Scripts/Player/PlayerInputHandler.cs +++ b/Assets/Code/Scripts/Player/PlayerInputHandler.cs @@ -1,36 +1,35 @@ using UnityEngine; using UnityEngine.InputSystem; -using UnityEngine.Windows; public class PlayerInputController : MonoBehaviour { public InputActionAsset InputActions; + private InputAction m_headInteractAction; private InputAction m_moveAction; private InputAction m_lookAction; private InputAction m_jumpAction; private InputAction m_throwAction; - private InputAction m_pickupAction; private InputAction m_shiftAction; public Vector2 MoveAmount { get; private set; } public Vector2 LookAmount { get; private set; } + public bool HeadInteractionPressed { get; private set; } public bool JumpPressed { get; private set; } public bool ShiftPressed { get; private set; } public bool ThrowPressed { get; private set; } - public bool PickupPressed { get; private set; } private void Awake() { var map = InputActions.FindActionMap("Player"); + m_headInteractAction = map.FindAction("HeadInteract"); m_moveAction = map.FindAction("Move"); m_lookAction = map.FindAction("Look"); m_jumpAction = map.FindAction("Jump"); m_shiftAction = map.FindAction("Shift"); m_throwAction = map.FindAction("Throw"); - m_pickupAction = map.FindAction("Pickup"); } private void OnEnable() @@ -51,6 +50,6 @@ public class PlayerInputController : MonoBehaviour ShiftPressed = m_shiftAction.IsPressed(); JumpPressed = m_jumpAction.WasPressedThisFrame(); ThrowPressed = m_throwAction.WasPressedThisFrame(); - PickupPressed = m_pickupAction.WasPressedThisFrame(); + HeadInteractionPressed = m_headInteractAction.WasPressedThisFrame(); } } \ No newline at end of file diff --git a/Assets/Level/Prefabs/Interactives/Button.prefab b/Assets/Level/Prefabs/Interactives/Button.prefab index d6952ee..ca331fe 100644 --- a/Assets/Level/Prefabs/Interactives/Button.prefab +++ b/Assets/Level/Prefabs/Interactives/Button.prefab @@ -13,7 +13,6 @@ GameObject: - component: {fileID: 7188501903215599936} - component: {fileID: 2249752946204529007} - component: {fileID: 8097217384448450469} - - component: {fileID: 3970929985668534253} - component: {fileID: 9200216552899707794} - component: {fileID: 3436190445336344638} m_Layer: 0 @@ -34078,28 +34077,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6532970485135766022} m_Mesh: {fileID: 0} ---- !u!64 &3970929985668534253 -MeshCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6532970485135766022} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 5 - m_Convex: 0 - m_CookingOptions: 30 - m_Mesh: {fileID: 0} --- !u!135 &9200216552899707794 SphereCollider: m_ObjectHideFlags: 0 diff --git a/Assets/Level/Scenes/DevRoom.unity b/Assets/Level/Scenes/DevRoom.unity index 92ac7a8..0913b16 100644 --- a/Assets/Level/Scenes/DevRoom.unity +++ b/Assets/Level/Scenes/DevRoom.unity @@ -493,17 +493,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Assembly-CSharp::PlayerMovement InputActions: {fileID: 0} - CameraTransform: {fileID: 0} - MaxLookAngle: 90 - WalkSpeed: 10 - RotateSpeed: 5 - JumpForce: 5 - GroundCheck: {fileID: 0} - GroundCheckRadius: 0.2 - animator: {fileID: 0} - Head: {fileID: 0} - ThrowForce: 10 - PickupDistance: 3 --- !u!114 &43211589 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 6921400718617286756, guid: 2f9e8e4a19f939f43a84c1c7d0a0e185, type: 3} @@ -38238,7 +38227,7 @@ GameObject: - component: {fileID: 1225232290} - component: {fileID: 1225232289} - component: {fileID: 1225232288} - m_Layer: 0 + m_Layer: 3 m_Name: Floor m_TagString: Untagged m_Icon: {fileID: 0} @@ -72873,7 +72862,7 @@ MeshCollider: serializedVersion: 5 m_Convex: 0 m_CookingOptions: 30 - m_Mesh: {fileID: 163208307} + m_Mesh: {fileID: 1925451917} --- !u!33 &1434828806 MeshFilter: m_ObjectHideFlags: 10 @@ -109741,7 +109730,7 @@ MeshCollider: serializedVersion: 5 m_Convex: 0 m_CookingOptions: 30 - m_Mesh: {fileID: 1076043271} + m_Mesh: {fileID: 163208307} --- !u!33 &2017727403 MeshFilter: m_ObjectHideFlags: 10 diff --git a/Assets/Settings/PhysicsMaterial/Player/No_Frcition.physicMaterial.meta b/Assets/Settings/PhysicsMaterial/Player/No_Frcition.physicMaterial.meta index e0b522f..9ea5312 100644 --- a/Assets/Settings/PhysicsMaterial/Player/No_Frcition.physicMaterial.meta +++ b/Assets/Settings/PhysicsMaterial/Player/No_Frcition.physicMaterial.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f7ddf8204ae4327bb84e928c9ae561d4 +guid: f9ccf03e1da5f4a4683903447659b3d7 NativeFormatImporter: externalObjects: {} mainObjectFileID: 13400000