This commit is contained in:
Mrhongxing committed 2026-09-24 16:54:34 +08:00
1 parent 98487211bb
commit af3141ee0e
15 files changed
+9187 -2

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5e04b494473954c4aba97c984b187f33
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+249
View File
@@ -0,0 +1,249 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animation
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 89.98, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.48333332
value: {x: 136.09, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 89.98, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 1573878500
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 89.98
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.48333332
value: 136.09
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 89.98
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.48333332
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.48333332
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
classID: 4
script: {fileID: 0}
flags: 0
m_EulerEditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: "\u9AA8\u67B6/\u9AA8\u9ABC"
classID: 4
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f5fd933bef15e4bb6be98838ac984a30
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-1877133190484646992
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: f6a287b7656ac48fba803c02c20a77df, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &-1801463876161342736
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -1877133190484646992}
m_Position: {x: 280, y: 60, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -1877133190484646992}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PlayerCharactor
serializedVersion: 5
m_AnimatorParameters:
- m_Name: New Trigger
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: isRunning
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -1801463876161342736}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7b49e4bc5cf404d48bd248cfc3e00396
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
+345
View File
@@ -0,0 +1,345 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!90 &9000000
Avatar:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u4EBA\u7269Avatar"
m_AvatarSize: 3288
m_Avatar:
serializedVersion: 3
m_AvatarSkeleton:
data:
m_Node:
- m_ParentId: -1
m_AxesId: -1
- m_ParentId: 0
m_AxesId: -1
- m_ParentId: 0
m_AxesId: -1
- m_ParentId: 0
m_AxesId: -1
- m_ParentId: 3
m_AxesId: -1
- m_ParentId: 4
m_AxesId: -1
- m_ParentId: 5
m_AxesId: -1
- m_ParentId: 6
m_AxesId: -1
- m_ParentId: 7
m_AxesId: -1
- m_ParentId: 8
m_AxesId: -1
- m_ParentId: 5
m_AxesId: -1
- m_ParentId: 10
m_AxesId: -1
- m_ParentId: 11
m_AxesId: -1
- m_ParentId: 12
m_AxesId: -1
- m_ParentId: 5
m_AxesId: -1
- m_ParentId: 14
m_AxesId: -1
- m_ParentId: 15
m_AxesId: -1
- m_ParentId: 3
m_AxesId: -1
- m_ParentId: 17
m_AxesId: -1
- m_ParentId: 18
m_AxesId: -1
- m_ParentId: 19
m_AxesId: -1
- m_ParentId: 3
m_AxesId: -1
- m_ParentId: 21
m_AxesId: -1
- m_ParentId: 22
m_AxesId: -1
- m_ParentId: 23
m_AxesId: -1
m_ID: 000000002bdeef0216fccfad0b406e52e47acf5dcf6d199ac194177de8dfe8f52c8935c76a3bb129241dd01d35d41e3bc869d7e8c1ff1a43abe9ba6d8636d93d4e58b4a46909999224b2b6e92066095910eaafa1e6fdf3e2975071ef6730d4c659fefb17
m_AxesArray: []
m_AvatarSkeletonPose:
data:
m_X:
- t: {x: 0, y: 0, z: 0}
q: {x: 0, y: 0, z: 0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 1.4045105, z: 0}
q: {x: -0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 100, y: 100, z: 100}
- t: {x: -0, y: 0, z: 0}
q: {x: -0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 100, y: 100, z: 100}
- t: {x: -0, y: 0, z: 0}
q: {x: -0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 100, y: 100, z: 100}
- t: {x: -0, y: 0, z: -0.0069771237}
q: {x: 0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.0031910827, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.004645982, z: 0}
q: {x: 0.00000007322481, y: -0.00000007419605, z: 0.7230621, w: 0.690783}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: -1.8626458e-11, y: 0.0053579723, z: 6.661338e-18}
q: {x: -0.000000021770807, y: 0.000000117480916, z: 0.40216106, w: 0.91556895}
s: {x: 1, y: 1, z: 1}
- t: {x: 4.2188474e-17, y: 0.0039344197, z: -4.440892e-18}
q: {x: 0.0000000017089552, y: -0.00000023335012, z: 0.033488486, w: 0.9994391}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: -0, y: 0.0037334075, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.004645982, z: 0}
q: {x: -0.0000000737317, y: -0.000000066199945, z: -0.7230621, w: 0.690783}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: 1.8626444e-11, y: 0.0053579723, z: -8.881784e-18}
q: {x: 0.000000006023427, y: 0.00000031795994, z: -0.40216106, w: 0.91556895}
s: {x: 1, y: 1, z: 1}
- t: {x: 1.9650947e-16, y: 0.0039344197, z: 1.4210854e-16}
q: {x: 0.000000003895277, y: -0.00000024580436, z: -0.033488486, w: 0.9994391}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: -0, y: 0.0037334075, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.004645982, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.0030943023, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.0051320135, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0, z: -0.0069771237}
q: {x: 0, y: 0, z: -0.7071068, w: 0.7071067}
s: {x: 0.99999994, y: 0.99999994, z: 1}
- t: {x: -0, y: 0.003233169, z: -5.9604643e-10}
q: {x: -0.716112, y: 0.000000012121055, z: 0.00000008378011, w: 0.69798535}
s: {x: 1, y: 1, z: 1.0000001}
- t: {x: -7.105427e-17, y: 0.0052997903, z: 1.11758866e-10}
q: {x: -0.008674319, y: 0.000000021503926, z: 6.776712e-10, w: 0.9999624}
s: {x: 1, y: 1, z: 0.99999994}
- t: {x: -0, y: 0.005058197, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0, z: -0.0069771237}
q: {x: -0.50000006, y: 0.4999999, z: 0.5, w: 0.5}
s: {x: 0.9999999, y: 0.9999998, z: 0.99999994}
- t: {x: -0, y: 0.0032331692, z: 0}
q: {x: 0.5063676, y: 0.49355024, z: -0.50636756, w: 0.49355027}
s: {x: 1.0000001, y: 1.0000001, z: 1.0000001}
- t: {x: 8.881784e-18, y: 0.0052997917, z: -1.490116e-10}
q: {x: 0.008674317, y: 0.0000000815719, z: 1.8181068e-10, w: 0.9999624}
s: {x: 1, y: 1, z: 0.99999994}
- t: {x: -0, y: 0.005058197, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
m_DefaultPose:
data:
m_X:
- t: {x: 0, y: 0, z: 0}
q: {x: 0, y: 0, z: 0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 1.4045105, z: 0}
q: {x: -0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 100, y: 100, z: 100}
- t: {x: -0, y: 0, z: 0}
q: {x: -0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 100, y: 100, z: 100}
- t: {x: -0, y: 0, z: 0}
q: {x: -0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 100, y: 100, z: 100}
- t: {x: -0, y: 0, z: -0.0069771237}
q: {x: 0.7071068, y: 0, z: -0, w: 0.7071067}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.0031910827, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.004645982, z: 0}
q: {x: 0.00000007322481, y: -0.00000007419605, z: 0.7230621, w: 0.690783}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: -1.8626458e-11, y: 0.0053579723, z: 6.661338e-18}
q: {x: -0.000000021770807, y: 0.000000117480916, z: 0.40216106, w: 0.91556895}
s: {x: 1, y: 1, z: 1}
- t: {x: 4.2188474e-17, y: 0.0039344197, z: -4.440892e-18}
q: {x: 0.0000000017089552, y: -0.00000023335012, z: 0.033488486, w: 0.9994391}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: -0, y: 0.0037334075, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.004645982, z: 0}
q: {x: -0.0000000737317, y: -0.000000066199945, z: -0.7230621, w: 0.690783}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: 1.8626444e-11, y: 0.0053579723, z: -8.881784e-18}
q: {x: 0.000000006023427, y: 0.00000031795994, z: -0.40216106, w: 0.91556895}
s: {x: 1, y: 1, z: 1}
- t: {x: 1.9650947e-16, y: 0.0039344197, z: 1.4210854e-16}
q: {x: 0.000000003895277, y: -0.00000024580436, z: -0.033488486, w: 0.9994391}
s: {x: 0.99999994, y: 1, z: 1}
- t: {x: -0, y: 0.0037334075, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.004645982, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.0030943023, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0.0051320135, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0, z: -0.0069771237}
q: {x: 0, y: 0, z: -0.7071068, w: 0.7071067}
s: {x: 0.99999994, y: 0.99999994, z: 1}
- t: {x: -0, y: 0.003233169, z: -5.9604643e-10}
q: {x: -0.716112, y: 0.000000012121055, z: 0.00000008378011, w: 0.69798535}
s: {x: 1, y: 1, z: 1.0000001}
- t: {x: -7.105427e-17, y: 0.0052997903, z: 1.11758866e-10}
q: {x: -0.008674319, y: 0.000000021503926, z: 6.776712e-10, w: 0.9999624}
s: {x: 1, y: 1, z: 0.99999994}
- t: {x: -0, y: 0.005058197, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
- t: {x: -0, y: 0, z: -0.0069771237}
q: {x: -0.50000006, y: 0.4999999, z: 0.5, w: 0.5}
s: {x: 0.9999999, y: 0.9999998, z: 0.99999994}
- t: {x: -0, y: 0.0032331692, z: 0}
q: {x: 0.5063676, y: 0.49355024, z: -0.50636756, w: 0.49355027}
s: {x: 1.0000001, y: 1.0000001, z: 1.0000001}
- t: {x: 8.881784e-18, y: 0.0052997917, z: -1.490116e-10}
q: {x: 0.008674317, y: 0.0000000815719, z: 1.8181068e-10, w: 0.9999624}
s: {x: 1, y: 1, z: 0.99999994}
- t: {x: -0, y: 0.005058197, z: 0}
q: {x: 0, y: -0, z: -0, w: 1}
s: {x: 1, y: 1, z: 1}
m_SkeletonNameIDArray: 000000002bdeef0216fccfad0b406e52df1dcd02be20aad82f3d1548b90d123f5c84d55f3254eb2dcab4d22870e5dbb1e6d5dcc6e22e4b6a4540b858d370bf2f42db0be58b85c93131d4c0a8a7e4c7df47fd17a10471a3419241a4362810adaf3772f769
m_Human:
data:
serializedVersion: 2
m_RootX:
t: {x: 0, y: 0, z: 0}
q: {x: 0, y: 0, z: 0, w: 1}
s: {x: 1, y: 1, z: 1}
m_Skeleton:
data:
m_Node: []
m_ID:
m_AxesArray: []
m_SkeletonPose:
data:
m_X: []
m_LeftHand:
data:
m_HandBoneIndex: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_RightHand:
data:
m_HandBoneIndex: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_HumanBoneIndex: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_HumanBoneMass:
- 0.14545456
- 0.12121213
- 0.12121213
- 0.048484854
- 0.048484854
- 0.009696971
- 0.009696971
- 0.030303033
- 0.14545456
- 0.14545456
- 0.012121214
- 0.048484854
- 0.006060607
- 0.006060607
- 0.024242427
- 0.024242427
- 0.01818182
- 0.01818182
- 0.006060607
- 0.006060607
- 0.0024242427
- 0.0024242427
- 0
- 0
- 0
m_Scale: 1
m_ArmTwist: 0.5
m_ForeArmTwist: 0.5
m_UpperLegTwist: 0.5
m_LegTwist: 0.5
m_ArmStretch: 0.05
m_LegStretch: 0.05
m_FeetSpacing: 0
m_HasLeftHand: 0
m_HasRightHand: 0
m_HasTDoF: 0
m_HumanSkeletonIndexArray:
m_HumanSkeletonReverseIndexArray:
m_RootMotionBoneIndex: 3
m_RootMotionBoneX:
t: {x: 0, y: 0, z: 0}
q: {x: -0.7071068, y: -0, z: -0, w: 0.7071067}
s: {x: 1, y: 1, z: 1}
m_RootMotionSkeleton:
data:
m_Node:
- m_ParentId: -1
m_AxesId: -1
- m_ParentId: 0
m_AxesId: -1
m_ID: 000000000b406e52
m_AxesArray: []
m_RootMotionSkeletonPose:
data:
m_X: []
m_RootMotionSkeletonIndexArray: 0000000003000000
m_TOS:
1037645446: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.014/\u9AA8\u9ABC.015"
2585357775: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007"
3906431432: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.011/\u9AA8\u9ABC.012/\u9AA8\u9ABC.013"
1493788192: "\u9AA8\u67B6/\u9AA8\u9ABC.001/\u9AA8\u9ABC.002/\u9AA8\u9ABC.003"
1573878500: "\u9AA8\u67B6/\u9AA8\u9ABC"
2098697409: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.008"
49274411: "\u7403\u4F53"
991876149: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.011/\u9AA8\u9ABC.012"
2916088854: "\u7ACB\u65B9\u4F53"
1125842881: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.011/\u9AA8\u9ABC.012/\u9AA8\u9ABC.013/\u9AA8\u9ABC.013_end"
1382957067: "\u9AA8\u67B6"
402390617: "\u9AA8\u67B6/\u9AA8\u9ABC.004/\u9AA8\u9ABC.005/\u9AA8\u9ABC.006/\u9AA8\u9ABC.006_end"
500178212: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.011"
3342174508: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.008/\u9AA8\u9ABC.009/\u9AA8\u9ABC.010"
4017180823: "\u9AA8\u67B6/\u9AA8\u9ABC.004/\u9AA8\u9ABC.005"
0:
2459502953: "\u9AA8\u67B6/\u9AA8\u9ABC.001"
3807641062: "\u9AA8\u67B6/\u9AA8\u9ABC.004"
1840966059: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.014"
2763282510: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.014/\u9AA8\u9ABC.015/\u9AA8\u9ABC.015_end"
699480938: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.008/\u9AA8\u9ABC.009/\u9AA8\u9ABC.010/\u9AA8\u9ABC.010_end"
2712660496: "\u9AA8\u67B6/\u9AA8\u9ABC.001/\u9AA8\u9ABC.002/\u9AA8\u9ABC.003/\u9AA8\u9ABC.003_end"
3335794791: "\u9AA8\u67B6/\u9AA8\u9ABC.004/\u9AA8\u9ABC.005/\u9AA8\u9ABC.006"
3921064484: "\u9AA8\u67B6/\u9AA8\u9ABC.001/\u9AA8\u9ABC.002"
4125679592: "\u9AA8\u67B6/\u9AA8\u9ABC/\u9AA8\u9ABC.007/\u9AA8\u9ABC.008/\u9AA8\u9ABC.009"
m_HumanDescription:
serializedVersion: 3
m_Human: []
m_Skeleton: []
m_ArmTwist: 0.5
m_ForeArmTwist: 0.5
m_UpperLegTwist: 0.5
m_LegTwist: 0.5
m_ArmStretch: 0.05
m_LegStretch: 0.05
m_FeetSpacing: 0
m_GlobalScale: 1
m_RootMotionBoneName: "\u9AA8\u67B6"
m_HasTranslationDoF: 0
m_HasExtraRoot: 0
m_SkeletonHasParents: 1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 765bf08ea4f4e4e3a9a011cdb6150bb0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9000000
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f6a287b7656ac48fba803c02c20a77df
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
+2 -2
View File
@@ -91,7 +91,7 @@ ModelImporter:
legStretch: 0.05 legStretch: 0.05
feetSpacing: 0 feetSpacing: 0
globalScale: 1 globalScale: 1
rootMotionBoneName: rootMotionBoneName: "\u9AA8\u67B6"
hasTranslationDoF: 0 hasTranslationDoF: 0
hasExtraRoot: 0 hasExtraRoot: 0
skeletonHasParents: 1 skeletonHasParents: 1
@@ -99,7 +99,7 @@ ModelImporter:
autoGenerateAvatarMappingIfUnspecified: 1 autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2 animationType: 2
humanoidOversampling: 1 humanoidOversampling: 1
avatarSetup: 0 avatarSetup: 1
addHumanoidExtraRootOnlyWhenUsingAvatar: 1 addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1 importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0 remapMaterialsIfMaterialImportModeIsNone: 0
Binary file not shown.
+109
View File
@@ -0,0 +1,109 @@
fileFormatVersion: 2
guid: 1bcea6247f7234082b05ce5686d20231
ModelImporter:
serializedVersion: 22200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 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
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
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}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c304e6cc53c4f4cb89aab6d18878cf94
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+381
View File
@@ -0,0 +1,381 @@
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
public class moveForPlayer : MonoBehaviour
{
[Header("相机设置")]
[SerializeField] private GameObject playerCamera; // 玩家相机,用于计算投
[Header("跳跃缓存触发阈值")]
[SerializeField] private float willJumpFloat = 0.3f;
[Header("移动设置")]
[SerializeField] private float moveSpeed = 5f; // 基础移动速度
[SerializeField] private float sprintMultiplier = 2f; // 加速倍数(按住Shift)
[SerializeField] private float rotationSpeed = 2f; // 鼠标旋转灵敏度
/* [Header("平滑设置")]
[SerializeField] private float smoothTime = 0.05f; // 移动平滑时间 */
[Header("可切换摄像头")]
[SerializeField] private Camera[] cameras; // 可切换的摄像机数组
[Header("跳跃设置")]
[SerializeField] private float jumpHeight = 2f; // 跳跃高度
[SerializeField] private float gravity = 9.81f; // 重力加速度
[SerializeField] private float fallMultiplier = 2.5f; // 下落加速倍率(让下落更自然)
[SerializeField] private float heartHeight = 3f; // 掉落高度(超过这个高度就会掉血)
[Header("后座力系统")]
[SerializeField] private float recoilOffsetX = 0f; // 累积的后座力垂直偏移
[SerializeField] private float recoilOffsetY = 0f; // 累积的后座力水平偏移
[SerializeField] private float recoilRecoveryXSpeed = 5f; // 后座力恢复
[SerializeField] private float recoilRecoveryYSpeed = 8f; // 恢复
[SerializeField] private float recoilRecoveryX = 5f; // 后座力恢复
[SerializeField] public float recoilRecoveryY = 8f; // 恢复速度
[Header("其他设置")]
[SerializeField] private Animator playerAnimator; // 玩家动画控制器
private float currentRotationX = 0f; // 存储当前X轴旋转(俯仰角),范围-89~89度
private float currentRotationY = 0f; // 存储当前Y轴旋转(偏航角),可以无限累加
//private Vector3 velocityRef = Vector3.zero; // SmoothDamp的内部速度缓存,用于计算平滑
private bool isInputEnabled = false; // 是否允许输入,初始为false,按下ESC键后切换为true
private bool isMouseLocked = false; // 鼠标是否锁定,初始为false,按下ESC键后切换为true
private CharacterController controller; // 玩家控制器组件引用
private Vector3 translationY; // 用于存储Y轴方向的移动量,避免直接修改transform.position
private bool isJumping = false; // 玩家是否正在跳跃
private bool isFalling = false; // 玩家是否正在下落
private Vector3 GroundPosition; // 玩家在地面上的位置,用于判断是否离开地面
private float timer; // 用于计时,判断玩家是否离开地面超过一定时间
private bool isGrounded; // 玩家是否在地面上
private bool willJump = false; // 玩家是否即将跳跃
private float offsetY = 0f; // 用于存储摄像机的Y轴偏移量,避免直接修改transform.position
private float offsetX = 0f; // 用于存储摄像机的X轴偏移量,避免直接修改transform.position
private bool isRecoilRecovering = false; // 是否正在恢复后座力
private float timerForStart = 0f; // 用于计时,判断是否开始
void Start()
{
for (int i = 0; i < cameras.Length; i++)
{
if (i == 0)
{
EnableInput(); // 启用输入
LockMouse(); // 锁定鼠标
cameras[i].enabled = true; // 启用第一个摄像机
}
else
{
cameras[i].enabled = false; // 禁用其他摄像机
}
}
controller = GetComponent<CharacterController>();
Vector3 euler = transform.eulerAngles;// 获取初始旋转角度
currentRotationX = euler.x;
currentRotationY = euler.y;
controller.Move(Vector3.down * 100f * Time.deltaTime);// 确保玩家在地面上,避免一开始就悬空
GroundPosition = transform.position; // 初始化地面位置
isGrounded = controller.isGrounded; // 初始化玩家是否在地面上
}
// Update is called once per frame
void Update()
{
/* timerForStart += Time.deltaTime;
if(timerForStart < 20f)
{
return; // 等待0.5秒后再执行后续逻辑
} */
HandleRecoilTimeDecay();
if (Input.GetKeyDown(KeyCode.T))
{
// 切换摄像机
for (int i = 0; i < cameras.Length; i++)
{
if (cameras[i].enabled)
{
cameras[i].enabled = false;
cameras[(i + 1) % cameras.Length].enabled = true;
if (i == 0)
{
LockMouse(); // 切换到第一个摄像机时锁定鼠标
EnableInput(); // 启用输入
}
else
{
DisableInput(); // 禁用输入
FreeMouse(); // 释放鼠标
}
break;
}
}
}
if (isInputEnabled)
{
HandleAltKey();
HandleMovement();
if (isMouseLocked)
{
HandleRotation();
}
else
{
//HandleForRecoilTimeDecay();
}
//ApplySmoothMovement();
}
}
void HandleRotation()
{
float mouseX = Input.GetAxis("Mouse X") * rotationSpeed; // 鼠标X轴移动量,乘以旋转速度
float mouseY = Input.GetAxis("Mouse Y") * rotationSpeed; // 鼠标Y轴移动量,乘以旋转速度
currentRotationY += mouseX + offsetX;
currentRotationX -= mouseY + offsetY;
currentRotationX = Mathf.Clamp(currentRotationX, -89f, 89f);
//playerCamera.transform.rotation = Quaternion.Euler(currentRotationX, currentRotationY, 0f);
transform.rotation = Quaternion.Euler(0f, currentRotationY, 0f);
Quaternion rotation = Quaternion.Euler(currentRotationX, currentRotationY, 0);
// 核心公式:玩家位置 - (相机朝向 * 距离) + 高度偏移
Vector3 targetPosition = transform.position - (rotation * Vector3.forward * 2f); // 10f是相机距离,2f是高度偏移
// 3. 将相机的“位置”平滑移动到目标位置
//playerCamera.transform.position = Vector3.Lerp(playerCamera.transform.position, targetPosition, 10f * Time.deltaTime);
playerCamera.transform.position = targetPosition; // 直接设置位置,避免平滑移动导致的穿模问题
// 4. 让相机始终“看向”玩家上半身的位置
playerCamera.transform.LookAt(transform.position+ Vector3.up * 0.5f); // 让相机看向玩家上半身的位置,避免看向地面
targetPosition = transform.position - (rotation * Vector3.forward * 4f)+Vector3.up;// + rotation * Vector3.right * 1f; // 10f是相机距离,2f是高度偏移
playerCamera.transform.position = targetPosition;
}
void HandleForRecoilTimeDecay()
{
currentRotationY += offsetX;
currentRotationX -= offsetY;
currentRotationX = Mathf.Clamp(currentRotationX, -89f, 89f);
playerCamera.transform.rotation = Quaternion.Euler(currentRotationX, currentRotationY, 0f);
transform.rotation = Quaternion.Euler(0f, currentRotationY, 0f);
}
void HandleRecoilTimeDecay()
{
if (recoilOffsetX != 0 || recoilOffsetY > 0)
{
if (recoilOffsetX != 0)
{
offsetX = recoilOffsetX * recoilRecoveryXSpeed * Time.deltaTime; // 将累积的后座力偏移应用到摄像机的X轴旋转上
recoilOffsetX -= offsetX; // 后座力恢复
if (-0.1f < recoilOffsetX && recoilOffsetX < 0.1f)
{
recoilOffsetX = 0f;
}
}
if (recoilOffsetY > 0)
{
offsetY = recoilOffsetY * recoilRecoveryYSpeed * Time.deltaTime; // 将累积的后座力偏移应用到摄像机的Y轴旋转上
recoilOffsetY -= offsetY; // 后座力恢复
if (recoilOffsetY < 0.1f)
{
recoilOffsetY = 0f;
}
}
}
else if (isRecoilRecovering)
{
recoilOffsetX = Mathf.MoveTowards(recoilOffsetX, 0f, recoilRecoveryX * Time.deltaTime); // 后座力恢复
recoilOffsetY = Mathf.MoveTowards(recoilOffsetY, 0f, recoilRecoveryY * Time.deltaTime); // 后座力恢复
if (recoilOffsetX < 0.01f)
{
recoilOffsetX = 0f;
isRecoilRecovering = false; // 停止恢复后座力
}
if (recoilOffsetY < 0.01f)
{
recoilOffsetY = 0f;
isRecoilRecovering = false; // 停止恢复后座力
}
}
else
{
offsetX = 0f; // 将累积的后座力偏移应用到摄像机的X轴旋转上
offsetY = 0f; // 将累积的后座力偏移应用到摄像机的Y轴旋转上
}
}
void HandleMovement()
{
if (controller.isGrounded && isJumping)
{
isFalling = false; // 玩家在空中且Y轴方向的移动量小于0,设置下落状态为true
}
else if (controller.isGrounded)
{
if (transform.position.y - GroundPosition.y < -heartHeight)
{
// 玩家从高处掉落,需要掉血
Debug.Log("玩家从高处掉落,需要掉血");
//GameManager.Instance.BeShoted(10); // 调用GameManager的BeShoted方法,传入掉血值
GroundPosition = transform.position; // 更新地面位置
isFalling = false; // 玩家在空中且Y轴方向的移动量
isJumping = false; // 玩家在空中且Y轴方向的移动量
timer = 0f; // 重置计时器
}
else
{
GroundPosition = transform.position; // 更新地面位置
isFalling = false; // 玩家在空中且Y轴方向的移动量
isJumping = false; // 玩家在空中且Y轴方向的移动量
timer = 0f; // 重置计时器
}
}
else if (isGrounded && !controller.isGrounded && !isFalling && !isJumping)
{
isFalling = true; // 玩家在空中且Y轴方向的移动量小于0,设置下落状态为true
timer = 0f; // 重置计时器
}
if (transform.position.y >= (GroundPosition.y + jumpHeight) && !isFalling)
{
timer = 0f; // 玩家在空中且Y轴方向的移动量大于0,重置计时器为0
transform.position = new Vector3(transform.position.x, GroundPosition.y + jumpHeight, transform.position.z); // 玩家在空中且Y轴方向的移动量大于0,重置Y轴方向的移动量为1.5
isFalling = true; // 玩家在空中且Y轴方向的移动量大于0,设置下落状态为true
isJumping = false; // 玩家在空中且Y轴方向的移动量大于0,设置跳跃状态为false
}
isGrounded = controller.isGrounded; // 检测玩家是否在地面上
if (isJumping)
{
// 计算跳跃速度,使用公式 v = sqrt(2 * g * h)
float jumpVelocity = (Mathf.Sqrt(2f * jumpHeight / gravity) - timer) * gravity; // 计算跳跃速度,使用公式 v = sqrt(2 * g * h)
timer += Time.deltaTime; // 增加计时器
translationY.y = jumpVelocity * Time.deltaTime; // 设置Y轴方向的移动量为跳跃速度
}
else if (isFalling)
{
// 计算跳跃速度,使用公式 v = sqrt(2 * g * h)
float jumpVelocity = gravity * timer; // 计算跳跃速度,使用公式 v = g * t
timer += Time.deltaTime; // 增加计时器
translationY.y = -jumpVelocity * Time.deltaTime; // 设置Y轴方向的移动量为跳跃速度
}
else
{
translationY.y = 0f; // 在地面上,Y轴方向的移动量为0
}
float horizontal = Input.GetAxis("Horizontal"); // 获取水平输入(A/D或左右箭头)
float vertical = Input.GetAxis("Vertical"); // 获取垂直输入(W/S或上下箭头)
if (!willJump && Mathf.Approximately(horizontal, 0f) && !Input.GetKeyDown(KeyCode.Space) && Mathf.Approximately(vertical, 0f))
{
if (translationY.y != 0f)
{
controller.Move(translationY); // 没有输入,只处理Y轴方向的移动
}
else
{
controller.Move(Vector3.down * 10f * Time.deltaTime);
}
//playerAnimator.SetBool("isRunning", false); // 设置动画参数
return; // 没有输入,直接返回
}
if (controller.isGrounded && Input.GetKeyDown(KeyCode.Space))
{
timer = 0f; // 玩家按下跳跃键,重置计时器为0
isJumping = true; // 玩家按下跳跃键,设置跳跃状态为true
isFalling = false; // 玩家按下跳跃键,设置下落状态为false
willJump = false; // 玩家按下跳跃键,设置即将跳跃状态为false
}
else if (willJump && controller.isGrounded)
{
timer = 0f; // 玩家按下跳跃键,重置计时器为0
isJumping = true; // 玩家按下跳跃键,设置跳跃状态为true
isFalling = false; // 玩家按下跳跃键,设置下落状态为false
willJump = false; // 玩家按下跳跃键,设置即将跳跃状态为false
}
else if (Input.GetKeyDown(KeyCode.Space) && isFalling && transform.position.y <= GroundPosition.y + willJumpFloat)
{
willJump = true; // 玩家按下跳跃键,设置即将跳跃状态为true
}
float currentSpeed = moveSpeed;
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
{
currentSpeed *= sprintMultiplier; // 按住Shift键,加速移动
}
Vector3 forward = playerCamera.transform.forward; // 获取摄像机的前方向
Vector3 right = playerCamera.transform.right; // 获取摄像机的右方向
forward.y = 0f;
right.y = 0f;
// 重新归一化,保持方向向量长度为1
forward.Normalize();
right.Normalize();
Vector3 moveDirection = (forward * vertical + right * horizontal).normalized; // 计算移动方向并归一化
if (moveDirection.magnitude > 1f)
{
moveDirection.Normalize(); // 防止斜向移动速度过快
}
if (translationY.y == 0f)
{
//playerAnimator.SetBool("isRunning", moveDirection.magnitude > 0f); // 设置动画参数
controller.Move(moveDirection * currentSpeed * Time.deltaTime + Vector3.down * 10f * Time.deltaTime); // 使用CharacterController移动
}
else
{
controller.Move(moveDirection * currentSpeed * Time.deltaTime + translationY); // 使用CharacterController移动
}
}
void ApplySmoothMovement()
{
// 使用 SmoothDamp 实现平滑跟随,避免移动突兀
// 参数:当前位置,目标位置,引用速度变量,平滑时间
/* playerRigidbody.position = Vector3.SmoothDamp(
transform.position,
targetPosition,
ref velocityRef,
smoothTime
); */
//playerRigidbody.MovePosition(targetPosition);
}
void HandleAltKey()// 检测Alt键状态,切换鼠标锁定状态
{
if (!Input.GetKey(KeyCode.LeftAlt) && !Input.GetKey(KeyCode.RightAlt))
{
LockMouse();
}
else
{
FreeMouse();
}
}
void FreeMouse()// 释放鼠标
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
isMouseLocked = false;
}
void LockMouse()// 锁定鼠标
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
isMouseLocked = true;
}
public void EnableInput()// 启用输入
{
isInputEnabled = true;
}
public void DisableInput()// 禁用输入
{
isInputEnabled = false;
}
public void ApplyRecoil(float recoilAmountX, float recoilAmountY)
{
// 累积后座力偏移,限制在最大值范围内
recoilOffsetX += recoilAmountX;
recoilOffsetY += recoilAmountY;
}
public void ChangeIsRecoilRecovering(bool isRecovering)
{
recoilOffsetX = -recoilRecoveryX;
recoilOffsetY = -recoilRecoveryY;
isRecoilRecovering = isRecovering;
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5a10392cbfeb94729bfbecbffa6e38d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: