LisKiril commit
This commit is contained in:
@ -1 +1,5 @@
|
||||
{"count":1,"self":53.1106048,"total":53.237429,"children":{"InitializeActuators":{"count":2,"self":0.0019932,"total":0.0019932,"children":null},"InitializeSensors":{"count":2,"self":0.0019554999999999998,"total":0.0059847,"children":{"CreateObservableSensors":{"count":1,"self":0.0040292,"total":0.0040292,"children":null}}},"AgentSendState":{"count":1955,"self":0.0487552,"total":0.0846104,"children":{"CollectObservations":{"count":1955,"self":0.0069507,"total":0.0069507,"children":null},"WriteActionMask":{"count":1955,"self":0.0133727,"total":0.0133727,"children":null},"RequestDecision":{"count":1955,"self":0.0155318,"total":0.0155318,"children":null}}},"DecideAction":{"count":1955,"self":0.0238471,"total":0.0238471,"children":null},"AgentAct":{"count":1955,"self":0.0083594999999999989,"total":0.0083594999999999989,"children":null}},"gauges":{"Defender Behaviour.CumulativeReward":{"count":1,"max":0,"min":0,"runningAverage":0,"value":0,"weightedAverage":0},"NPC.CumulativeReward":{"count":19,"max":0,"min":0,"runningAverage":0,"value":0,"weightedAverage":0}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1650269333","unity_version":"2019.4.36f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2019.4.36f1\\Editor\\Unity.exe -projectpath D:\\real-shooter-git -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-0gxjnU2tE3R1JAgVcOu84 -hubSessionId 617c85c0-beed-11ec-9737-adc452e9defe -accessToken jGHX5jX1yB9hRz2Om-mndr4yVItZwtReMKF_pNdib-I012f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Greatest_map_ever","end_time_seconds":"1650269386"}}
|
||||
<<<<<<< HEAD
|
||||
{"count":1,"self":53.1106048,"total":53.237429,"children":{"InitializeActuators":{"count":2,"self":0.0019932,"total":0.0019932,"children":null},"InitializeSensors":{"count":2,"self":0.0019554999999999998,"total":0.0059847,"children":{"CreateObservableSensors":{"count":1,"self":0.0040292,"total":0.0040292,"children":null}}},"AgentSendState":{"count":1955,"self":0.0487552,"total":0.0846104,"children":{"CollectObservations":{"count":1955,"self":0.0069507,"total":0.0069507,"children":null},"WriteActionMask":{"count":1955,"self":0.0133727,"total":0.0133727,"children":null},"RequestDecision":{"count":1955,"self":0.0155318,"total":0.0155318,"children":null}}},"DecideAction":{"count":1955,"self":0.0238471,"total":0.0238471,"children":null},"AgentAct":{"count":1955,"self":0.0083594999999999989,"total":0.0083594999999999989,"children":null}},"gauges":{"Defender Behaviour.CumulativeReward":{"count":1,"max":0,"min":0,"runningAverage":0,"value":0,"weightedAverage":0},"NPC.CumulativeReward":{"count":19,"max":0,"min":0,"runningAverage":0,"value":0,"weightedAverage":0}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1650269333","unity_version":"2019.4.36f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2019.4.36f1\\Editor\\Unity.exe -projectpath D:\\real-shooter-git -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-0gxjnU2tE3R1JAgVcOu84 -hubSessionId 617c85c0-beed-11ec-9737-adc452e9defe -accessToken jGHX5jX1yB9hRz2Om-mndr4yVItZwtReMKF_pNdib-I012f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Greatest_map_ever","end_time_seconds":"1650269386"}}
|
||||
=======
|
||||
{"count":1,"self":19.9775968,"total":20.018629999999998,"children":{"InitializeActuators":{"count":1,"self":0.0010006,"total":0.0010006,"children":null},"AgentSendState":{"count":765,"self":0.0057472999999999995,"total":0.0057472999999999995,"children":null},"DecideAction":{"count":765,"self":0.0332866,"total":0.0332866,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1649742457","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real-shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 21e9de90-ba14-11ec-9398-079edccf5e34 -accessToken oIpf_7gKWQQRilVTeJehUsFhrxasdzsG_K3j5Swtgx0009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Greatest_map_ever","end_time_seconds":"1649742477"}}
|
||||
>>>>>>> lisin/character/1
|
||||
|
@ -1 +1 @@
|
||||
{"count":1,"self":14.5494256,"total":14.5766034,"children":{"InitializeActuators":{"count":1,"self":0,"total":0,"children":null},"AgentSendState":{"count":497,"self":0.0020012999999999997,"total":0.0020012999999999997,"children":null},"DecideAction":{"count":497,"self":0.0241768,"total":0.0241768,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1649741696","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real-shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 21e9de90-ba14-11ec-9398-079edccf5e34 -accessToken oIpf_7gKWQQRilVTeJehUsFhrxasdzsG_K3j5Swtgx0009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"dont touch me plz","end_time_seconds":"1649741711"}}
|
||||
{"count":1,"self":16.6838208,"total":16.712662599999998,"children":{"InitializeActuators":{"count":1,"self":0,"total":0,"children":null},"AgentSendState":{"count":576,"self":0.0019632,"total":0.0019632,"children":null},"DecideAction":{"count":576,"self":0.0258802,"total":0.0258802,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1650178667","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real-shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 98771190-be1a-11ec-9c09-9dc92f6b967a -accessToken s8caeOYfqx6g6xnYk94RfMv2OTjaX6uA5gfR3X2X-yU009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"dont touch me plz","end_time_seconds":"1650178683"}}
|
8
Assets/Materials/New Material.mat
generated
8
Assets/Materials/New Material.mat
generated
@ -37,11 +37,11 @@ Material:
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Scale: {x: 2, y: 2}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Texture: {fileID: 2800000, guid: e2d3ffb9e0c5b7a4d95d18b01f2c27e1, type: 3}
|
||||
m_Scale: {x: 2, y: 2}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
@ -61,7 +61,7 @@ Material:
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _Glossiness: 0.52
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
|
5374
Assets/Scenes/dont touch me plz.unity
generated
5374
Assets/Scenes/dont touch me plz.unity
generated
File diff suppressed because it is too large
Load Diff
246
Assets/Scenes/tyt player/Player.prefab
generated
246
Assets/Scenes/tyt player/Player.prefab
generated
@ -1,5 +1,56 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4839747462788443060
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8723084081118426009}
|
||||
- component: {fileID: 5958306789513936477}
|
||||
m_Layer: 0
|
||||
m_Name: WeaponAnimations
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8723084081118426009
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4839747462788443060}
|
||||
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:
|
||||
- {fileID: 4936565370263846416}
|
||||
m_Father: {fileID: 8510909888689775087}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!95 &5958306789513936477
|
||||
Animator:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4839747462788443060}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 1ae0500836ae5b040ab0c41e276bf073, 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!1 &5245491127989480125
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -159,6 +210,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 9826297ef4d853741b2af768441ec7f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
input_Movement: {x: 0, y: 0}
|
||||
input_View: {x: 0, y: 0}
|
||||
cameraHolder: {fileID: 5245491129196666053}
|
||||
feetTransform: {fileID: 5245491129603592455}
|
||||
@ -201,6 +253,7 @@ MonoBehaviour:
|
||||
CameraHeight: -0.58
|
||||
StanceCollider: {fileID: 5245491127989480121}
|
||||
currentWeapon: {fileID: 8510909888689775086}
|
||||
weaponAnimationSpeed: 0
|
||||
--- !u!114 &8693388664594773644
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -363,99 +416,6 @@ Transform:
|
||||
m_Father: {fileID: 5245491127989480103}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8510909888198732725
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8510909888198732726}
|
||||
- component: {fileID: 8510909888198732713}
|
||||
- component: {fileID: 8510909888198732712}
|
||||
- component: {fileID: 8510909888198732727}
|
||||
m_Layer: 8
|
||||
m_Name: WeaponModel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8510909888198732726
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8510909888198732725}
|
||||
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: 8510909888689775087}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8510909888198732713
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8510909888198732725}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &8510909888198732712
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8510909888198732725}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
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!65 &8510909888198732727
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8510909888198732725}
|
||||
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!1 &8510909888689775085
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -482,9 +442,9 @@ Transform:
|
||||
m_GameObject: {fileID: 8510909888689775085}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0.332, y: 0.038, z: 0.394}
|
||||
m_LocalScale: {x: 0.16226998, y: 0.1581135, z: 1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8510909888198732726}
|
||||
- {fileID: 8723084081118426009}
|
||||
m_Father: {fileID: 5245491129196666053}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -508,3 +468,99 @@ MonoBehaviour:
|
||||
SwayResetSmoothing: 0.1
|
||||
SwayClampX: 8
|
||||
SwayClampY: 8
|
||||
MovementSwayX: 0
|
||||
MovementSwayY: 0
|
||||
MovementSwayYInverted: 0
|
||||
MovementSwayXInverted: 0
|
||||
MovementSwaySmoothing: 0
|
||||
weaponAnimator: {fileID: 5958306789513936477}
|
||||
--- !u!1001 &142004959385982218
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 8723084081118426009}
|
||||
m_Modifications:
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.12767105
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.12767106
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.12767103
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.098
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.25399977
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0.81
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 180
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -927199367670048503, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AKM
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, type: 3}
|
||||
--- !u!4 &4936565370263846416 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 142004959385982218}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
2659
Assets/SciFiWarriorPBRHPPolyart/Prefabs/PBRCharacter.prefab
generated
2659
Assets/SciFiWarriorPBRHPPolyart/Prefabs/PBRCharacter.prefab
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f432554f564e69242897607d34218939
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,5 +1,126 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4990518237621721504
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2899293721311086279}
|
||||
- component: {fileID: 882715573061308690}
|
||||
- component: {fileID: 4617010341778439690}
|
||||
m_Layer: 0
|
||||
m_Name: Camera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2899293721311086279
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4990518237621721504}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 17878.16, z: 616.4097}
|
||||
m_LocalScale: {x: 100, y: 100, z: 100}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351696}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!20 &882715573061308690
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4990518237621721504}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
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: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!81 &4617010341778439690
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4990518237621721504}
|
||||
m_Enabled: 1
|
||||
--- !u!1 &6277443649044622161
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4627080026632482293}
|
||||
m_Layer: 0
|
||||
m_Name: CameraHolder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4627080026632482293
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6277443649044622161}
|
||||
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:
|
||||
- {fileID: 7207249014110603258}
|
||||
- {fileID: 7072444061591351728}
|
||||
- {fileID: 7072444061591351740}
|
||||
- {fileID: 7072444061591351712}
|
||||
- {fileID: 7072444061591351714}
|
||||
- {fileID: 7072444061591351696}
|
||||
- {fileID: 7072444061591351702}
|
||||
- {fileID: 7072444061591351684}
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7072444061591710752
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -515,12 +636,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711104}
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0, y: -138.49533, z: 34.48629}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -138.49533, z: 34.48629}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 2
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!137 &7072444061578043540
|
||||
SkinnedMeshRenderer:
|
||||
@ -654,12 +775,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711106}
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0.0000018693923, y: -129.49721, z: -6.0212374}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -129.49721, z: -6.0212374}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 3
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!137 &7072444061578043542
|
||||
SkinnedMeshRenderer:
|
||||
@ -987,12 +1108,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711120}
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0, y: -163.22968, z: -0.3527179}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -163.22968, z: -0.3527179}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 0
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!137 &7072444061578043536
|
||||
SkinnedMeshRenderer:
|
||||
@ -1278,12 +1399,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711132}
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -118.131454, y: -98.01, z: -57.969975}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 1
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!137 &7072444061578043538
|
||||
SkinnedMeshRenderer:
|
||||
@ -1715,6 +1836,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 7072444061591351794}
|
||||
- component: {fileID: 7072444061582351952}
|
||||
- component: {fileID: 6146116838354622185}
|
||||
m_Layer: 0
|
||||
m_Name: PolyartCharacter
|
||||
m_TagString: Untagged
|
||||
@ -1733,13 +1855,7 @@ Transform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 7072444061591351728}
|
||||
- {fileID: 7072444061591351740}
|
||||
- {fileID: 7072444061591351712}
|
||||
- {fileID: 7072444061591351714}
|
||||
- {fileID: 7072444061591351696}
|
||||
- {fileID: 7072444061591351702}
|
||||
- {fileID: 7072444061591351684}
|
||||
- {fileID: 4627080026632482293}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -1762,6 +1878,63 @@ Animator:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorControllerStateOnDisable: 0
|
||||
--- !u!114 &6146116838354622185
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711186}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9826297ef4d853741b2af768441ec7f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
input_Movement: {x: 0, y: 0}
|
||||
input_View: {x: 0, y: 0}
|
||||
cameraHolder: {fileID: 4627080026632482293}
|
||||
feetTransform: {fileID: 7072444061591351684}
|
||||
playerSettings:
|
||||
ViewXSensetivity: 0
|
||||
ViewYSensetivity: 0
|
||||
ViewXInverted: 0
|
||||
ViewYInverted: 0
|
||||
SprintingHold: 0
|
||||
MovementSmoothing: 0
|
||||
RunningForwardSpeed: 0
|
||||
RunningStrafeSpeed: 0
|
||||
WalkingForwardSpeed: 0
|
||||
WalkingBackwardSpeed: 0
|
||||
WalkingStrafeSpeed: 0
|
||||
JumpingHeight: 0
|
||||
JumpingFalloff: 0
|
||||
FallingSmoothing: 0
|
||||
SpeedEffector: 1
|
||||
CrouchSpeedEffector: 0
|
||||
ProneSpeedEffector: 0
|
||||
FallingSpeedEffector: 0
|
||||
ViewClampYMin: -70
|
||||
ViewClampYMax: 80
|
||||
playerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
gravityAmount: 0
|
||||
gravityMin: 0
|
||||
jumpingForce: {x: 0, y: 0, z: 0}
|
||||
playerStance: 0
|
||||
playerStanceSmoothing: 0
|
||||
playerStandStance:
|
||||
CameraHeight: 0
|
||||
StanceCollider: {fileID: 0}
|
||||
playerCrouchStance:
|
||||
CameraHeight: 0
|
||||
StanceCollider: {fileID: 0}
|
||||
playerProneStance:
|
||||
CameraHeight: 0
|
||||
StanceCollider: {fileID: 0}
|
||||
isSprinting: 0
|
||||
currentWeapon: {fileID: 0}
|
||||
weaponAnimationSpeed: 0
|
||||
--- !u!1 &7072444061591711188
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2032,12 +2205,12 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711204}
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0, y: -96.69518, z: -8.197696}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -96.69518, z: -8.197696}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 6
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!137 &7072444061578043546
|
||||
SkinnedMeshRenderer:
|
||||
@ -2325,12 +2498,13 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711216}
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0, y: -176.9416, z: -6.1230974}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -176.9416, z: -6.1230974}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 4
|
||||
m_Children:
|
||||
- {fileID: 2899293721311086279}
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!137 &7072444061578043544
|
||||
SkinnedMeshRenderer:
|
||||
@ -2524,16 +2698,16 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7072444061591711222}
|
||||
m_LocalRotation: {x: -0.4582423, y: 0.5385295, z: -0.4582423, w: 0.5385295}
|
||||
m_LocalPosition: {x: -0, y: 1.0650933, z: 0.038611155}
|
||||
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_LocalPosition: {x: 0, y: 1.0650933, z: 0.038611155}
|
||||
m_LocalScale: {x: 0.010000001, y: 0.01, z: 0.01}
|
||||
m_Children:
|
||||
- {fileID: 7072444061591351736}
|
||||
- {fileID: 7072444061591351738}
|
||||
- {fileID: 7072444061591351760}
|
||||
- {fileID: 7072444061591351756}
|
||||
- {fileID: 7072444061591351758}
|
||||
m_Father: {fileID: 7072444061591351794}
|
||||
m_RootOrder: 5
|
||||
m_Father: {fileID: 4627080026632482293}
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7072444061591711224
|
||||
GameObject:
|
||||
@ -2657,3 +2831,53 @@ Transform:
|
||||
m_Father: {fileID: 7072444061591351682}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7976818881840838822
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7207249014110603258}
|
||||
- component: {fileID: 1822822644330576206}
|
||||
m_Layer: 0
|
||||
m_Name: CharacterAnimator
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7207249014110603258
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7976818881840838822}
|
||||
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: 4627080026632482293}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!95 &1822822644330576206
|
||||
Animator:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7976818881840838822}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 6defa2fea7e9a934a8d2cafa30dc567a, 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
|
||||
|
@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Barracuda;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
using static scr_Models;
|
||||
|
||||
@ -11,7 +12,9 @@ public class scr_CharacterController : MonoBehaviour
|
||||
|
||||
private CharacterController characterController;
|
||||
private DefaultInput defaultInput;
|
||||
private Vector2 input_Movement;
|
||||
|
||||
[HideInInspector]
|
||||
public Vector2 input_Movement;
|
||||
[HideInInspector]
|
||||
public Vector2 input_View;
|
||||
|
||||
@ -48,12 +51,23 @@ public class scr_CharacterController : MonoBehaviour
|
||||
private float cameraHeight;
|
||||
private float cameraHeightVelocity;
|
||||
|
||||
private bool isSprinting;
|
||||
[HideInInspector]
|
||||
public bool isSprinting;
|
||||
|
||||
private Vector3 newMovementSpeed;
|
||||
private Vector3 newMovementSpeedVelocity;
|
||||
|
||||
[Header("Weapon")] public scr_WeaponController currentWeapon;
|
||||
[Header("Weapon")]
|
||||
public scr_WeaponController currentWeapon;
|
||||
|
||||
public float weaponAnimationSpeed;
|
||||
|
||||
public float damage = 10f;
|
||||
public float range = 100f;
|
||||
|
||||
public Camera fpsCam;
|
||||
public ParticleSystem muzzleFlash;
|
||||
public GameObject impactEffect;
|
||||
private void Awake()
|
||||
{
|
||||
defaultInput = new DefaultInput();
|
||||
@ -75,22 +89,45 @@ public class scr_CharacterController : MonoBehaviour
|
||||
characterController = GetComponent<CharacterController>();
|
||||
|
||||
cameraHeight = cameraHolder.localPosition.y;
|
||||
|
||||
|
||||
if (currentWeapon)
|
||||
{
|
||||
currentWeapon.Initialise(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetButtonDown("Fire1"))
|
||||
{
|
||||
Shoot();
|
||||
}
|
||||
CalculateView();
|
||||
CalculateMovement();
|
||||
CalculateJump();
|
||||
CalculateCameraHeight();
|
||||
}
|
||||
|
||||
void Shoot()
|
||||
{
|
||||
muzzleFlash.Play();
|
||||
RaycastHit hit;
|
||||
if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))
|
||||
{
|
||||
Debug.Log(hit.transform.name);
|
||||
|
||||
Target target = hit.transform.GetComponent<Target>();
|
||||
if (target != null)
|
||||
{
|
||||
target.TakeDamage(damage);
|
||||
}
|
||||
|
||||
Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void CalculateView()
|
||||
{
|
||||
newCharacterRotation.y += playerSettings.ViewXSensetivity * (playerSettings.ViewXInverted ? -input_View.x : input_View.x) * Time.deltaTime;
|
||||
@ -119,6 +156,7 @@ public class scr_CharacterController : MonoBehaviour
|
||||
}
|
||||
|
||||
// Effectors
|
||||
|
||||
if (!characterController.isGrounded)
|
||||
{
|
||||
playerSettings.SpeedEffector = playerSettings.FallingSpeedEffector;
|
||||
@ -136,6 +174,13 @@ public class scr_CharacterController : MonoBehaviour
|
||||
playerSettings.SpeedEffector = 1;
|
||||
}
|
||||
|
||||
weaponAnimationSpeed = characterController.velocity.magnitude / (playerSettings.WalkingForwardSpeed * playerSettings.SpeedEffector);
|
||||
|
||||
if (weaponAnimationSpeed > 1)
|
||||
{
|
||||
weaponAnimationSpeed = 1;
|
||||
}
|
||||
|
||||
verticalSpeed *= playerSettings.SpeedEffector;
|
||||
horizontalSpeed *= playerSettings.SpeedEffector;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public static class scr_Models
|
||||
[Serializable]
|
||||
public class WeaponSettingsModel
|
||||
{
|
||||
[Header("Sway")]
|
||||
[Header("Weapon Sway")]
|
||||
public float SwayAmount;
|
||||
public bool SwayYInverted;
|
||||
public bool SwayXInverted;
|
||||
@ -69,6 +69,13 @@ public static class scr_Models
|
||||
public float SwayResetSmoothing;
|
||||
public float SwayClampX;
|
||||
public float SwayClampY;
|
||||
|
||||
[Header("Weapon Movement Sway")]
|
||||
public float MovementSwayX;
|
||||
public float MovementSwayY;
|
||||
public bool MovementSwayYInverted;
|
||||
public bool MovementSwayXInverted;
|
||||
public float MovementSwaySmoothing;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1,20 +1,31 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using static scr_Models;
|
||||
|
||||
public class scr_WeaponController : MonoBehaviour
|
||||
{
|
||||
private scr_CharacterController characterController;
|
||||
[Header("Settings")]
|
||||
public WeaponSettingsModel settings;
|
||||
|
||||
[Header("References")]
|
||||
public Animator weaponAnimator;
|
||||
|
||||
private bool isInitialised;
|
||||
|
||||
Vector3 newWeaponRotation;
|
||||
Vector3 newWeaponRotationVelocity;
|
||||
|
||||
|
||||
Vector3 targetWeaponRotation;
|
||||
Vector3 targetWeaponRotationVelocity;
|
||||
|
||||
Vector3 newWeaponMovementRotation;
|
||||
Vector3 newWeaponRotationMovementVelocity;
|
||||
|
||||
Vector3 targetWeaponMovementRotation;
|
||||
Vector3 targetWeaponMovementRotationVelocity;
|
||||
private void Start()
|
||||
{
|
||||
newWeaponRotation = transform.localRotation.eulerAngles;
|
||||
@ -32,6 +43,13 @@ public class scr_WeaponController : MonoBehaviour
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CalculateWeaponRotation();
|
||||
SetWeaponAnimation();
|
||||
}
|
||||
private void CalculateWeaponRotation()
|
||||
{
|
||||
weaponAnimator.speed = characterController.weaponAnimationSpeed;
|
||||
|
||||
targetWeaponRotation.y += settings.SwayAmount * (settings.SwayXInverted ? -characterController.input_View.x : characterController.input_View.x) * Time.deltaTime;
|
||||
targetWeaponRotation.x += settings.SwayAmount * (settings.SwayYInverted ? characterController.input_View.y : -characterController.input_View.y) * Time.deltaTime;
|
||||
@ -40,9 +58,23 @@ public class scr_WeaponController : MonoBehaviour
|
||||
targetWeaponRotation.x = Mathf.Clamp(targetWeaponRotation.x, -settings.SwayClampX, settings.SwayClampX);
|
||||
targetWeaponRotation.y = Mathf.Clamp(targetWeaponRotation.y, -settings.SwayClampY, settings.SwayClampY);
|
||||
|
||||
targetWeaponRotation.z = targetWeaponRotation.y;
|
||||
|
||||
targetWeaponRotation = Vector3.SmoothDamp(targetWeaponRotation, Vector3.zero, ref targetWeaponRotationVelocity, settings.SwayResetSmoothing);
|
||||
newWeaponRotation = Vector3.SmoothDamp(newWeaponRotation, targetWeaponRotation, ref newWeaponRotationVelocity, settings.SwaySmoothing);
|
||||
|
||||
targetWeaponMovementRotation.z = settings.MovementSwayX * (settings.MovementSwayXInverted ? -characterController.input_Movement.x : characterController.input_Movement.x);
|
||||
targetWeaponMovementRotation.x = settings.MovementSwayY * (settings.MovementSwayYInverted ? -characterController.input_Movement.y : characterController.input_Movement.y);
|
||||
|
||||
targetWeaponMovementRotation = Vector3.SmoothDamp(targetWeaponMovementRotation, Vector3.zero, ref targetWeaponMovementRotationVelocity, settings.SwayResetSmoothing);
|
||||
newWeaponMovementRotation = Vector3.SmoothDamp(newWeaponRotation, targetWeaponMovementRotation, ref newWeaponRotationVelocity, settings.SwaySmoothing);
|
||||
|
||||
|
||||
transform.localRotation = Quaternion.Euler(newWeaponRotation);
|
||||
}
|
||||
|
||||
private void SetWeaponAnimation()
|
||||
{
|
||||
weaponAnimator.SetBool("isSprinting", characterController.isSprinting);
|
||||
}
|
||||
}
|
||||
|
6
ProjectSettings/ProjectSettings.asset
generated
6
ProjectSettings/ProjectSettings.asset
generated
@ -614,7 +614,11 @@ PlayerSettings:
|
||||
webGLLinkerTarget: 1
|
||||
webGLThreadsSupport: 0
|
||||
webGLWasmStreaming: 0
|
||||
scriptingDefineSymbols: {}
|
||||
scriptingDefineSymbols:
|
||||
1: CROSS_PLATFORM_INPUT
|
||||
4: CROSS_PLATFORM_INPUT;MOBILE_INPUT
|
||||
7: CROSS_PLATFORM_INPUT;MOBILE_INPUT
|
||||
14: MOBILE_INPUT
|
||||
platformArchitecture: {}
|
||||
scriptingBackend: {}
|
||||
il2cppCompilerConfiguration: {}
|
||||
|
Reference in New Issue
Block a user