diff --git a/Assets/Animations/manInjury.fbx b/Assets/Animations/manInjury.fbx new file mode 100644 index 0000000..af5a344 Binary files /dev/null and b/Assets/Animations/manInjury.fbx differ diff --git a/Assets/Animations/manInjury.fbx.meta b/Assets/Animations/manInjury.fbx.meta new file mode 100644 index 0000000..f46939d --- /dev/null +++ b/Assets/Animations/manInjury.fbx.meta @@ -0,0 +1,109 @@ +fileFormatVersion: 2 +guid: 36a64753ffd054a0e98c1efc8590f2a0 +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: diff --git a/Assets/Scenes/main.unity b/Assets/Scenes/main.unity index ac5db4d..471228f 100644 --- a/Assets/Scenes/main.unity +++ b/Assets/Scenes/main.unity @@ -2735,7 +2735,6 @@ GameObject: - component: {fileID: 441640511} - component: {fileID: 441640510} - component: {fileID: 441640516} - - component: {fileID: 441640517} m_Layer: 0 m_Name: '[Managers]' m_TagString: GameController @@ -2967,27 +2966,7 @@ MonoBehaviour: _blackScreenImage: {fileID: 0} _idleDuration: 2 _fadeDuration: 1 ---- !u!114 &441640517 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 441640509} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4aaf3f536776e4baa98839960d122cff, type: 3} - m_Name: - m_EditorClassIdentifier: - _manAnimator: {fileID: 0} - _man2Animator: {fileID: 0} - _man2Object: {fileID: 0} - _womanObject: {fileID: 0} - _manInjuryObject: {fileID: 0} - _blackScreenPanel: {fileID: 0} - _blackScreenImage: {fileID: 0} - _idleDuration: 2 - _fadeDuration: 1 + _fallHoldDuration: 1.5 --- !u!1 &458363765 GameObject: m_ObjectHideFlags: 0 @@ -6814,7 +6793,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1284093980 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index 3797e84..8726551 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -57,7 +57,7 @@ public class OpeningFlowController : MonoBehaviour } if (_womanObject == null) _womanObject = GameObject.Find("woman"); - if (_manInjuryObject == null) _manInjuryObject = GameObject.Find("maninjury"); + if (_manInjuryObject == null) _manInjuryObject = GameObject.Find("manInjury"); if (_blackScreenPanel == null) _blackScreenPanel = GameObject.Find("BlackScreenPanel"); @@ -94,24 +94,25 @@ public class OpeningFlowController : MonoBehaviour { Debug.Log("=== [OpeningFlow] 片头动画流程开始 ==="); + // 重置参数,让 Animator 默认进入 Idle(不调用 Play 避免重复触发) if (_manAnimator != null) { _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); - _manAnimator.Play("manIdle", 0, 0f); - Debug.Log("[OpeningFlow] man Animator 已重置: IsStart=false, IsFull=false, 强制播放 manIdle"); + Debug.Log("[OpeningFlow] man Animator 已重置: IsStart=false, IsFull=false, 默认 Idle"); } + // Step 1: Idle 2s Debug.Log($"[OpeningFlow] Step1: man + man2 Idle ({_idleDuration}s)"); yield return new WaitForSeconds(_idleDuration); - // Step 2: Shoot —— 每帧强制 IsFull=false 防止 Animator 中途切走 + // Step 2: Shoot —— 每帧锁定 IsFull=false Debug.Log("[OpeningFlow] Step2: man Shoot 动画开始"); if (_manAnimator != null) { _manAnimator.SetBool("IsFull", false); _manAnimator.SetBool("IsStart", true); - Debug.Log("[OpeningFlow] man IsStart=true, IsFull=false, 触发 Shoot,每帧锁定 IsFull=false"); + Debug.Log("[OpeningFlow] man IsStart=true, IsFull=false, 触发 Shoot"); float shootElapsed = 0f; while (shootElapsed < 3.15f) @@ -120,22 +121,20 @@ public class OpeningFlowController : MonoBehaviour _manAnimator.SetBool("IsFull", false); yield return null; } - _manAnimator.SetBool("IsStart", false); - Debug.Log("[OpeningFlow] Step2: man Shoot 动画结束"); - } - // Step 3: 摔倒 —— manfull 2.1s + 停留1s - Debug.Log("[OpeningFlow] Step3: man Fall 动画开始"); - if (_manAnimator != null) - { + // 关键:先设 IsFull=true 再清 IsStart,避免回到 Idle 闪一下 _manAnimator.SetBool("IsFull", true); - Debug.Log("[OpeningFlow] man IsFull=true, 触发 manfull (2.1s)"); - yield return new WaitForSeconds(2.1f); - Debug.Log("[OpeningFlow] Step3: man Fall 动画结束, 停留1s"); - yield return new WaitForSeconds(1f); + _manAnimator.SetBool("IsStart", false); + Debug.Log("[OpeningFlow] man IsStart=false, IsFull=true, 触发 manfull"); } - // Step 4: 黑幕转场 —— 渐入 -> 切换角色+摄像机 -> 渐出 + // Step 3: 摔倒 manfull (2.1s) + 看清停留 2s + Debug.Log("[OpeningFlow] Step3: man Fall 动画 (2.1s) + 停留 2s"); + yield return new WaitForSeconds(2.1f); + Debug.Log("[OpeningFlow] Step3: man Fall 动画结束, 停留 2s 让玩家看清摔倒"); + yield return new WaitForSeconds(2f); + + // Step 4: 黑幕转场 Debug.Log("[OpeningFlow] Step4: 黑幕转场开始"); yield return StartCoroutine(FadeBlackScreen(0f, 1f)); @@ -143,7 +142,7 @@ public class OpeningFlowController : MonoBehaviour if (_manAnimator != null) { _manAnimator.gameObject.SetActive(false); Debug.Log("[OpeningFlow] man 已隐藏"); } if (_man2Object != null) { _man2Object.SetActive(false); Debug.Log("[OpeningFlow] man2 已隐藏"); } if (_womanObject != null) { _womanObject.SetActive(true); Debug.Log("[OpeningFlow] woman 已显示"); } - if (_manInjuryObject != null) { _manInjuryObject.SetActive(true); Debug.Log("[OpeningFlow] maninjury 已显示"); } + if (_manInjuryObject != null) { _manInjuryObject.SetActive(true); Debug.Log("[OpeningFlow] manInjury 已显示"); } SwitchToCamera2();