Compare commits
5 Commits
e3852c7f60
...
d906c93460
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d906c93460 | ||
| 7a281dcb6c | |||
|
|
a9314979ad | ||
|
|
1dbc2734f3 | ||
|
|
67a1717b86 |
@@ -2,7 +2,7 @@
|
||||
- Project name: HeadlessHazard
|
||||
- Unity version: Unity 6000.3.10f1
|
||||
- Active game object:
|
||||
- Name: GroundCheck
|
||||
- Tag: Untagged
|
||||
- Name: Head
|
||||
- Tag: Player
|
||||
- Layer: Default
|
||||
<!-- UNITY CODE ASSIST INSTRUCTIONS END -->
|
||||
141
Assets/Art/Materials/Player/Trajectory Material.mat
Normal file
141
Assets/Art/Materials/Player/Trajectory Material.mat
Normal file
@@ -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
|
||||
8
Assets/Art/Materials/Player/Trajectory Material.mat.meta
Normal file
8
Assets/Art/Materials/Player/Trajectory Material.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51588d9f6325eb54eaa0c67389672860
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -25,7 +25,7 @@
|
||||
"initialStateCheck": true
|
||||
},
|
||||
{
|
||||
"name": "Pickup",
|
||||
"name": "HeadInteract",
|
||||
"type": "Button",
|
||||
"id": "5a0c555a-8fc4-4188-9eed-401eb8f017b5",
|
||||
"expectedControlType": "",
|
||||
@@ -504,7 +504,7 @@
|
||||
{
|
||||
"name": "",
|
||||
"id": "05a519b8-f991-4f43-a438-fbe3db38625b",
|
||||
"path": "<Mouse>/rightButton",
|
||||
"path": "<Mouse>/leftButton",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
@@ -519,7 +519,7 @@
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Pickup",
|
||||
"action": "HeadInteract",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
|
||||
@@ -34,22 +34,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 +68,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 +107,4 @@ public class PlayerHeadController : MonoBehaviour
|
||||
Head.localPosition = m_headInitialLocalPos;
|
||||
Head.localRotation = m_headInitialLocalRot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.Windows;
|
||||
|
||||
public class PlayerInputController : MonoBehaviour
|
||||
{
|
||||
@@ -10,8 +9,8 @@ public class PlayerInputController : MonoBehaviour
|
||||
private InputAction m_lookAction;
|
||||
private InputAction m_jumpAction;
|
||||
private InputAction m_throwAction;
|
||||
private InputAction m_pickupAction;
|
||||
private InputAction m_shiftAction;
|
||||
private InputAction m_headInteractAction;
|
||||
|
||||
public Vector2 MoveAmount { get; private set; }
|
||||
public Vector2 LookAmount { get; private set; }
|
||||
@@ -19,7 +18,7 @@ public class PlayerInputController : MonoBehaviour
|
||||
public bool JumpPressed { get; private set; }
|
||||
public bool ShiftPressed { get; private set; }
|
||||
public bool ThrowPressed { get; private set; }
|
||||
public bool PickupPressed { get; private set; }
|
||||
public bool HeadInteractionPressed { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -30,7 +29,7 @@ public class PlayerInputController : MonoBehaviour
|
||||
m_jumpAction = map.FindAction("Jump");
|
||||
m_shiftAction = map.FindAction("Shift");
|
||||
m_throwAction = map.FindAction("Throw");
|
||||
m_pickupAction = map.FindAction("Pickup");
|
||||
m_headInteractAction = map.FindAction("HeadInteract");
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,10 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: Head
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4513738306462009106, guid: 8ae6d0072edd3ef6a8e8fab748ba5098, type: 3}
|
||||
propertyPath: m_TagString
|
||||
value: Player
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4522719369371878407, guid: 8ae6d0072edd3ef6a8e8fab748ba5098, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
@@ -248,8 +252,29 @@ PrefabInstance:
|
||||
m_RemovedGameObjects:
|
||||
- {fileID: 2059550454731354505, guid: 459ef74c4ee79d3eb8e1ba6a0f06c9a7, type: 3}
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 1015176535145037065, guid: 459ef74c4ee79d3eb8e1ba6a0f06c9a7, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 2084843937911841166}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 459ef74c4ee79d3eb8e1ba6a0f06c9a7, type: 3}
|
||||
--- !u!1 &1446289441119343760 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 1015176535145037065, guid: 459ef74c4ee79d3eb8e1ba6a0f06c9a7, type: 3}
|
||||
m_PrefabInstance: {fileID: 1874870990122559897}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &2084843937911841166
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1446289441119343760}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1d8f349ed7dc088a4a6e2690ee87094a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PlayerMovement
|
||||
InputActions: {fileID: 0}
|
||||
--- !u!4 &6975610370707183838 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 8848088476524540231, guid: 459ef74c4ee79d3eb8e1ba6a0f06c9a7, type: 3}
|
||||
@@ -545,15 +570,15 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 1.48
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -6.57
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
@@ -561,7 +586,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
@@ -573,7 +598,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 82a2914d8f86c62488456950c8330e38, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
|
||||
@@ -5577,7 +5577,7 @@ GameObject:
|
||||
- component: {fileID: 1173887971}
|
||||
- component: {fileID: 1173887970}
|
||||
- component: {fileID: 1173887969}
|
||||
m_Layer: 0
|
||||
m_Layer: 3
|
||||
m_Name: Plate
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -7285,7 +7285,7 @@ GameObject:
|
||||
- component: {fileID: 1524676968}
|
||||
- component: {fileID: 1524676967}
|
||||
- component: {fileID: 1524676966}
|
||||
m_Layer: 0
|
||||
m_Layer: 3
|
||||
m_Name: Plate
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
|
||||
Reference in New Issue
Block a user