diff --git a/Assets/Objects/Human.blend b/Assets/Objects/Human.blend new file mode 100644 index 0000000..7c4c72b Binary files /dev/null and b/Assets/Objects/Human.blend differ diff --git a/Assets/Objects/Human.blend.meta b/Assets/Objects/Human.blend.meta new file mode 100644 index 0000000..2057a84 --- /dev/null +++ b/Assets/Objects/Human.blend.meta @@ -0,0 +1,105 @@ +fileFormatVersion: 2 +guid: 94eb43ab67867914c9ac3de46caa4c67 +ModelImporter: + serializedVersion: 21100 + internalIDToNameTable: + - first: + 74: -623603649343465320 + second: Scene + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 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 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + 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 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Objects/Human.blend1 b/Assets/Objects/Human.blend1 new file mode 100644 index 0000000..9e8cc94 Binary files /dev/null and b/Assets/Objects/Human.blend1 differ diff --git a/Assets/Objects/Human.blend1.meta b/Assets/Objects/Human.blend1.meta new file mode 100644 index 0000000..b876d8c --- /dev/null +++ b/Assets/Objects/Human.blend1.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9756c92c8fdab5b4185d547216209d30 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Objects/Human.fbx b/Assets/Objects/Human.fbx new file mode 100644 index 0000000..7fcf471 Binary files /dev/null and b/Assets/Objects/Human.fbx differ diff --git a/Assets/Objects/Human.fbx.meta b/Assets/Objects/Human.fbx.meta new file mode 100644 index 0000000..03a6b89 --- /dev/null +++ b/Assets/Objects/Human.fbx.meta @@ -0,0 +1,402 @@ +fileFormatVersion: 2 +guid: 25ca9c9cd2d467c4e9b7c7759baa0db2 +ModelImporter: + serializedVersion: 21100 + internalIDToNameTable: + - first: + 74: 8349542763059015795 + second: Armature|Walk + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 3 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: Armature|Walk + takeName: Armature|Walk + internalID: 0 + firstFrame: 0 + lastFrame: 24 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: + - boneName: Hip + humanName: Hips + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thigh_L + humanName: LeftUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thigh_R + humanName: RightUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Shin_L + humanName: LeftLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Shin_R + humanName: RightLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Foot_L + humanName: LeftFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Foot_R + humanName: RightFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Abdomen + humanName: Spine + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Chest + humanName: Chest + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Head + humanName: Head + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: UpperArm_L + humanName: LeftUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: UpperArm_R + humanName: RightUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Forearm_L + humanName: LeftLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Forearm_R + humanName: RightLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Hand_L + humanName: LeftHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Hand_R + humanName: RightHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + skeleton: + - name: Human(Clone) + parentName: + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Cube + parentName: Human(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071067, y: -0.000000030908616, z: 0.000000030908623, w: 0.7071068} + scale: {x: 100, y: 100, z: 100} + - name: Armature + parentName: Human(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071067, y: -0.000000030908616, z: 0.000000030908623, w: 0.7071068} + scale: {x: 100, y: 100, z: 100} + - name: Hip + parentName: Armature + position: {x: 7.948426e-10, y: 0.0000000017881393, z: 0.008924431} + rotation: {x: 0.7071068, y: -0.0000000020579487, z: -0.0000000020579605, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + - name: Abdomen + parentName: Hip + position: {x: -0, y: 0.0010998978, z: 0} + rotation: {x: -0, y: -0.000000116415315, z: 7.1054274e-15, w: 1} + scale: {x: 0.9999999, y: 1, z: 0.9999999} + - name: Chest + parentName: Abdomen + position: {x: -0, y: 0.002230785, z: 0} + rotation: {x: -0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.99999994} + - name: Head + parentName: Chest + position: {x: -0, y: 0.002965438, z: 0} + rotation: {x: -1.6584554e-17, y: 1.1934986e-10, z: -1.4246027e-10, w: 1} + scale: {x: 0.99999994, y: 0.9999998, z: 0.99999994} + - name: UpperArm_L + parentName: Chest + position: {x: -0.0013659928, y: 0.0018180575, z: -0.00022726202} + rotation: {x: -0.4864988, y: 0.46149784, z: 0.5357424, w: 0.51314586} + scale: {x: 0.99999976, y: 0.9999995, z: 1} + - name: Forearm_L + parentName: UpperArm_L + position: {x: -9.313225e-11, y: 0.0029282072, z: -7.4505804e-11} + rotation: {x: -0.009157031, y: -0.09181186, z: -0.038012516, w: -0.99500847} + scale: {x: 1.0000002, y: 0.9999999, z: 0.99999976} + - name: Hand_L + parentName: Forearm_L + position: {x: -1.3038516e-10, y: 0.0018045367, z: -5.820766e-11} + rotation: {x: 0.09934627, y: 0.7378955, z: -0.010978944, w: -0.667473} + scale: {x: 1.0000004, y: 1.0000006, z: 0.99999994} + - name: UpperArm_R + parentName: Chest + position: {x: 0.0013659928, y: 0.0018180575, z: -0.00022726262} + rotation: {x: 0.486499, y: 0.4614976, z: 0.53574234, w: -0.51314604} + scale: {x: 1.0000004, y: 1.0000004, z: 0.9999998} + - name: Forearm_R + parentName: UpperArm_R + position: {x: 1.8626451e-11, y: 0.002928207, z: -5.401671e-10} + rotation: {x: 0.009157239, y: -0.09181183, z: -0.038012635, w: 0.99500847} + scale: {x: 1.0000006, y: 1.0000002, z: 1.0000002} + - name: Hand_R + parentName: Forearm_R + position: {x: -7.4505804e-11, y: 0.0018045371, z: -5.3551046e-11} + rotation: {x: -0.09934638, y: 0.73789537, z: -0.010979169, w: 0.66747296} + scale: {x: 0.9999997, y: 0.9999999, z: 0.99999976} + - name: Thigh_L + parentName: Hip + position: {x: -0.00069675926, y: -0.00007037975, z: -0.00040403535} + rotation: {x: 0.7066821, y: -0.08031961, z: -0.70253026, w: -0.024505584} + scale: {x: 1.000001, y: 1, z: 1.0000001} + - name: Shin_L + parentName: Thigh_L + position: {x: -1.5366822e-10, y: 0.003972938, z: -1.6298145e-11} + rotation: {x: -0.00014329328, y: 0.008907664, z: 0.05948525, w: -0.9981895} + scale: {x: 1.0000004, y: 1.0000004, z: 1} + - name: Foot_L + parentName: Shin_L + position: {x: -2.3283064e-12, y: 0.0039656768, z: 1.36788e-10} + rotation: {x: 0.45208237, y: -0.604719, z: -0.36648977, w: -0.54371107} + scale: {x: 0.9999999, y: 1.0000004, z: 0.9999999} + - name: Thigh_R + parentName: Hip + position: {x: 0.00069675926, y: -0.00007037975, z: -0.00040403544} + rotation: {x: 0.70668215, y: 0.080319576, z: 0.7025302, w: -0.024505673} + scale: {x: 1.000001, y: 1.0000001, z: 1.0000005} + - name: Shin_R + parentName: Thigh_R + position: {x: -8.8475643e-11, y: 0.003972937, z: 2.2933817e-10} + rotation: {x: 0.00014321505, y: 0.008907782, z: 0.059485234, w: 0.9981895} + scale: {x: 1.0000005, y: 1.0000004, z: 1.0000005} + - name: Foot_R + parentName: Shin_R + position: {x: 3.7252902e-11, y: 0.003965677, z: -3.259629e-11} + rotation: {x: -0.45208243, y: -0.604719, z: -0.36648992, w: 0.54371107} + scale: {x: 0.99999964, y: 0.99999946, z: 1.0000005} + - name: Foot_Control_L + parentName: Armature + position: {x: -0.0013605166, y: -0.0016545627, z: -0.007761089} + rotation: {x: 0.999981, y: -3.552714e-15, z: 1.0658142e-14, w: 0.006168336} + scale: {x: 1, y: 0.99999994, z: 1.000678} + - name: Thigh_Control_L + parentName: Armature + position: {x: -0.00093339814, y: -0.006269274, z: -0.0039872816} + rotation: {x: 0.98892564, y: -0.000000008188669, z: -0.14841183, w: -8.881784e-16} + scale: {x: 1, y: 1, z: 0.99999994} + - name: UpperArm_Control_L + parentName: Armature + position: {x: -0.00085530936, y: -0.0039713676, z: 0.003075037} + rotation: {x: -0.2692533, y: -0.6538369, z: 0.6538369, w: 0.2692533} + scale: {x: 0.72619903, y: 0.99999976, z: 0.7314929} + - name: Hand_L.001 + parentName: Armature + position: {x: -0.0022795226, y: -0.00026142012, z: 0.0010587472} + rotation: {x: 0.00009068196, y: -0.7071068, z: 0.7071068, w: 0.00009159633} + scale: {x: 0.48980606, y: 0.99999964, z: 0.9999998} + - name: Foot_Control_R + parentName: Armature + position: {x: 0.0013605207, y: 0.0031248948, z: -0.0069798133} + rotation: {x: 0.999981, y: -0.000000025788854, z: -0.000004175075, w: 0.006168336} + scale: {x: 1, y: 0.99999994, z: 1.000678} + - name: Thigh_Control_R + parentName: Armature + position: {x: 0.00093339814, y: -0.006269274, z: -0.0039872816} + rotation: {x: 0.98892564, y: -0.000000008188669, z: 0.14841184, w: 1.5543122e-15} + scale: {x: 1, y: 1, z: 1.0000001} + - name: UpperArm_Control_R + parentName: Armature + position: {x: 0.00085530936, y: -0.0039713676, z: 0.003075037} + rotation: {x: 0.2692533, y: -0.6538369, z: 0.6538369, w: -0.2692533} + scale: {x: 0.72619903, y: 0.99999976, z: 0.7314929} + - name: Hand_R.001 + parentName: Armature + position: {x: 0.0022795226, y: -0.00026142012, z: 0.0010587472} + rotation: {x: -0.000090681955, y: -0.7071068, z: 0.7071068, w: -0.000091596325} + scale: {x: 0.48980606, y: 0.99999964, z: 0.9999998} + - name: LookAt + parentName: Armature + position: {x: -0, y: -0.0037967255, z: 0.0062961215} + rotation: {x: 0.7071068, y: -0.00000008429373, z: -0.000000084293724, w: 0.7071068} + scale: {x: 1, y: 0.9999998, z: 0.9999998} + 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: 1 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 3 + humanoidOversampling: 1 + avatarSetup: 1 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Objects/HumanAnimationControler.controller b/Assets/Objects/HumanAnimationControler.controller new file mode 100644 index 0000000..82b653c --- /dev/null +++ b/Assets/Objects/HumanAnimationControler.controller @@ -0,0 +1,122 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!206 &-7127493751781251651 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: [] + m_BlendParameter: Blend + m_BlendParameterY: Blend + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!1102 &-1129337770131920209 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Armature|Walk + 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: 8349542763059015795, guid: 25ca9c9cd2d467c4e9b7c7759baa0db2, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &-29801462378204144 +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: -1129337770131920209} + m_Position: {x: 240, y: 70, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1753614070743940096} + m_Position: {x: 130, y: 180, 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: -1129337770131920209} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: HumanAnimationControler + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: Blend + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -29801462378204144} + 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} +--- !u!1102 &1753614070743940096 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + 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: -7127493751781251651} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Objects/HumanAnimationControler.controller.meta b/Assets/Objects/HumanAnimationControler.controller.meta new file mode 100644 index 0000000..42b1600 --- /dev/null +++ b/Assets/Objects/HumanAnimationControler.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bcfd120671431f84097ebc1045370f76 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dirt2.fbx b/Assets/Scripts/Dirt2.fbx new file mode 100644 index 0000000..8f2e5ef Binary files /dev/null and b/Assets/Scripts/Dirt2.fbx differ diff --git a/Assets/Scripts/Dirt2.fbx.meta b/Assets/Scripts/Dirt2.fbx.meta new file mode 100644 index 0000000..7389af1 --- /dev/null +++ b/Assets/Scripts/Dirt2.fbx.meta @@ -0,0 +1,102 @@ +fileFormatVersion: 2 +guid: 95368b38c2191b9459eb8538ea67a64b +ModelImporter: + serializedVersion: 21100 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 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 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + 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 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Player/PlayerController.cs b/Assets/Scripts/Player/PlayerController.cs index 9a7023b..9dd5596 100644 --- a/Assets/Scripts/Player/PlayerController.cs +++ b/Assets/Scripts/Player/PlayerController.cs @@ -9,7 +9,14 @@ public class PlayerController : MonoBehaviour { [Header("Mouse Look")] [SerializeField] private Transform playerCamera = null; + [SerializeField] private Transform playerNeck = null; [SerializeField] private float mouseSensitivity = 4.0f; + + [SerializeField] private float maxCameraAngle = -90f; + [SerializeField] private float neckStartAngle = 0f; + [SerializeField] private float minCameraAngle = 90f; + + [SerializeField] private float neckLength = 0.2f; [SerializeField] [Range(0.0f, 0.5f)] private float mouseSmoothTime = 0.001f; [SerializeField] private bool lockCursor = true; @@ -25,8 +32,9 @@ public class PlayerController : MonoBehaviour [SerializeField] private LayerMask groundMask; public bool isGrounded; - + private float fullPitch = 0f; private float cameraPitch = 0f; + private float neckPitch = 0f; private float velocityY = 0.0f; private CharacterController controller; @@ -62,13 +70,32 @@ public class PlayerController : MonoBehaviour Vector2 targetMouseDelta = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); //Get the axis of the mouse currentMouseDelta = Vector2.SmoothDamp(currentMouseDelta, targetMouseDelta, ref currentMouseDeltaVelocity, mouseSmoothTime); + fullPitch -= currentMouseDelta.y * mouseSensitivity; + fullPitch = Mathf.Clamp(fullPitch,-maxCameraAngle,-minCameraAngle); + //cameraPitch = Mathf.Clamp(fullPitch, -90, 45); - cameraPitch -= currentMouseDelta.y * mouseSensitivity; //minus, weil der rotation wert inverted ist - cameraPitch = Mathf.Clamp(cameraPitch, -90.0f, 90.0f); + //neckPitch = Mathf.Clamp(fullPitch, 45, 90); + Debug.Log("fullPitch: " + fullPitch); - playerCamera.localEulerAngles = Vector3.right * cameraPitch; + if (fullPitch >= neckStartAngle) { + playerNeck.localEulerAngles = Vector3.right * (fullPitch - neckStartAngle); + + } + else { + playerCamera.localEulerAngles = Vector3.right * fullPitch; - transform.Rotate(Vector3.up * currentMouseDelta.x * mouseSensitivity); //Rotate the hole player if looked sideways + + } + playerCamera.position = playerNeck.position; + playerCamera.position += playerNeck.up * neckLength; + /* + playerNeck.localEulerAngles = Vector3.right * neckPitch; + playerCamera.localEulerAngles = Vector3.right * cameraPitch; + playerCamera.position = playerNeck.position; + playerCamera.position += playerNeck.up * neckLength;*/ + //playerCamera.RotateAround(playerNeck.position, Vector3.right, cameraPitch* Mathf.Deg2Rad - playerCamera.transform.rotation.x); + + transform.Rotate(Vector3.up * currentMouseDelta.x * mouseSensitivity); //Rotate the hole player if looked sideways (Rotates the player left and right) } private void UpdateMovement() {