上传YomovSDK
This commit is contained in:
2437
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Boxing.unity
Normal file
2437
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Boxing.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 723636789bb96481ba1f2aad8b8837e9
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2751
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Controller.unity
Normal file
2751
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Controller.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f097b72f6aff88c4c8120011f31f3891
|
||||
timeCreated: 1512476571
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
696
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Swing.unity
Normal file
696
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Swing.unity
Normal file
@@ -0,0 +1,696 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 1
|
||||
m_BakeResolution: 50
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 0
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 1024
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 0
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &5
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666666
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1001 &260883069
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9500000, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_Controller
|
||||
value:
|
||||
objectReference: {fileID: 9100000, guid: c6a41433f43f04320a84210d6839f609, type: 2}
|
||||
- target: {fileID: 9500000, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
propertyPath: m_ApplyRootMotion
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 959d14bf134f54a6e993fe6ca6e063c0, type: 3}
|
||||
--- !u!4 &326545851 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 400056, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &340743659
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 340743660}
|
||||
- component: {fileID: 340743661}
|
||||
- component: {fileID: 340743664}
|
||||
- component: {fileID: 340743662}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &340743660
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 340743659}
|
||||
m_LocalRotation: {x: 0.010451215, y: 0.9545902, z: -0.13709058, w: -0.2643001}
|
||||
m_LocalPosition: {x: 0.8828898, y: 1.6776807, z: 2.2280314}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!20 &340743661
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 340743659}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.2835821, g: 0.2835821, b: 0.2835821, a: 0.019607844}
|
||||
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: 100
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!81 &340743662
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 340743659}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &340743664
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 340743659}
|
||||
m_Enabled: 1
|
||||
--- !u!1 &600676766
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 600676768}
|
||||
- component: {fileID: 600676767}
|
||||
m_Layer: 0
|
||||
m_Name: READ ME!
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &600676767
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 600676766}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 92471cc1733c49042be56cd39b4b6e5e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
text: "AimIK is good for keeping objects steadily aimed at the target. Sometimes
|
||||
those objects have a lot of swinging motion in their animation though, like swinging
|
||||
a sword for example, and it is not good to use AimIK to keep the sword oriented
|
||||
towards a certain position during that swing. \nIt would keep the sword orientation
|
||||
fixed by bending the rest of the spine hierarchy and that would interfere with
|
||||
the animation in an unnatural way. \n\nIt is still possible to use AimIK to redirect
|
||||
swinging animations like swordplay or punching. For that, we would have to tell
|
||||
AimIK each frame that whatever the current animated pose, it is the default forward
|
||||
aiming pose.\n\nTake a look at AimSwing.cs to see how to dynamically adjust the
|
||||
\"Axis\" of AimIK to achieve redirection of weapon slashing animations.\n\nRight-click
|
||||
on any FinalIK component header and select \"User Manual\" or \"Script Reference\"
|
||||
for more info."
|
||||
--- !u!4 &600676768
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 600676766}
|
||||
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: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!4 &704622890 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 400052, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &886382057 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 400024, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1178531802
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1178531803}
|
||||
- component: {fileID: 1178531804}
|
||||
m_Layer: 0
|
||||
m_Name: Directional light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1178531803
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1178531802}
|
||||
m_LocalRotation: {x: 0.8722197, y: -0.22294034, z: -0.12568198, w: 0.41681477}
|
||||
m_LocalPosition: {x: -0.022630244, y: 3.5827851, z: 0.086004406}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!108 &1178531804
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1178531802}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 0.796
|
||||
m_Bias: 0.044
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 1
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!1 &1222256819
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1222256823}
|
||||
- component: {fileID: 1222256822}
|
||||
- component: {fileID: 1222256821}
|
||||
m_Layer: 0
|
||||
m_Name: Swing Target
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &1222256821
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1222256819}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: aae886dd0d5d59844b4ec40cc2d96918, type: 2}
|
||||
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: 0
|
||||
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!33 &1222256822
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1222256819}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1222256823
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1222256819}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.10584736, y: 1.2019104, z: 1.2010946}
|
||||
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1326096875
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1326096876}
|
||||
- component: {fileID: 1326096879}
|
||||
- component: {fileID: 1326096877}
|
||||
m_Layer: 0
|
||||
m_Name: Prop
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1326096876
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1326096875}
|
||||
m_LocalRotation: {x: 0.1777969, y: 0.000000059604645, z: -0.0000000037252903, w: 0.9840672}
|
||||
m_LocalPosition: {x: -0.105998725, y: -0.08122723, z: 0.35171276}
|
||||
m_LocalScale: {x: 0.068461396, y: 0.0684614, z: 0.8940683}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2003802864}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &1326096877
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1326096875}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: aec38ac1f2b4b994f9fe780ff5de7217, type: 2}
|
||||
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: 0
|
||||
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!33 &1326096879
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1326096875}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1426189641 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 400054, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &2003802864 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 400038, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &2082835393 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 100118, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &2082835394 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 400118, guid: 959d14bf134f54a6e993fe6ca6e063c0,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 260883069}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &2082835395
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2082835393}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5013856973b27429d937d256dc082f2e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
fixTransforms: 1
|
||||
solver:
|
||||
executedInEditor: 0
|
||||
IKPosition: {x: 0.0000024362898, y: 0.55411285, z: 2.86247}
|
||||
IKPositionWeight: 1
|
||||
root: {fileID: 2082835394}
|
||||
target: {fileID: 1222256823}
|
||||
tolerance: 0
|
||||
maxIterations: 4
|
||||
useRotationLimits: 0
|
||||
XY: 0
|
||||
bones:
|
||||
- transform: {fileID: 704622890}
|
||||
weight: 1
|
||||
solverPosition: {x: 0, y: 0, z: 0}
|
||||
solverRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
defaultLocalPosition: {x: -0.10531403, y: -0.00008385659, z: -2.3259054e-10}
|
||||
defaultLocalRotation: {x: 4.0745185e-14, y: 0, z: -0, w: 1}
|
||||
length: 0
|
||||
sqrMag: 0
|
||||
axis: {x: 0, y: 0, z: 0}
|
||||
- transform: {fileID: 1426189641}
|
||||
weight: 0.18844983
|
||||
solverPosition: {x: 0, y: 0, z: 0}
|
||||
solverRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
defaultLocalPosition: {x: -0.10531482, y: -0.00008385659, z: -2.3258327e-10}
|
||||
defaultLocalRotation: {x: -8.096637e-15, y: 0.000000010320556, z: -0.0037209948,
|
||||
w: 0.9999931}
|
||||
length: 0
|
||||
sqrMag: 0
|
||||
axis: {x: 0, y: 0, z: 0}
|
||||
- transform: {fileID: 326545851}
|
||||
weight: 0.23809524
|
||||
solverPosition: {x: 0, y: 0, z: 0}
|
||||
solverRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
defaultLocalPosition: {x: -0.10531482, y: -0.00008385468, z: -2.3258327e-10}
|
||||
defaultLocalRotation: {x: -1.1736887e-13, y: 0.000000010320554, z: -0.0037209955,
|
||||
w: 0.9999931}
|
||||
length: 0
|
||||
sqrMag: 0
|
||||
axis: {x: 0, y: 0, z: 0}
|
||||
- transform: {fileID: 886382057}
|
||||
weight: 0.5714286
|
||||
solverPosition: {x: 0, y: 0, z: 0}
|
||||
solverRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
defaultLocalPosition: {x: -0.10534644, y: -0.00010401631, z: -2.884772e-10}
|
||||
defaultLocalRotation: {x: 4.448862e-14, y: 0.0000004163574, z: -0.15011443,
|
||||
w: 0.9886686}
|
||||
length: 0
|
||||
sqrMag: 0
|
||||
axis: {x: 0, y: 0, z: 0}
|
||||
transform: {fileID: 886382057}
|
||||
axis: {x: 0, y: 1, z: 0}
|
||||
poleAxis: {x: 0, y: 0, z: 1}
|
||||
polePosition: {x: -3.0000007, y: 1.4099374, z: -0.01286416}
|
||||
poleWeight: 0
|
||||
poleTarget: {fileID: 0}
|
||||
clampWeight: 0.5
|
||||
clampSmoothing: 2
|
||||
--- !u!114 &2082835396
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2082835393}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8ccef35d59367884b8f5847c819438b4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
ik: {fileID: 2082835395}
|
||||
animatedAimDirection: {x: 0, y: -0.25, z: 1}
|
||||
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfa34265300d7414bbf930eaa6bfb70e
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2919
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Weapon.unity
Normal file
2919
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Aim Weapon.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 912d260eace234ee1b283ba7f07dd3d7
|
||||
timeCreated: 1433755866
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
3109
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/AimIK Pole.unity
Normal file
3109
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/AimIK Pole.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cb81a7ab90c447829d4d26f8ca89245
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a2af3d7e2f50d2458c893c63a1ab835
|
||||
folderAsset: yes
|
||||
timeCreated: 1434626795
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace RootMotion.Demos {
|
||||
|
||||
/// <summary>
|
||||
/// Boxing with Aim IK.
|
||||
/// Changing character facing direction with Aim IK to follow the target.
|
||||
/// </summary>
|
||||
public class AimBoxing : MonoBehaviour {
|
||||
|
||||
public AimIK aimIK; // Reference to the AimIK component
|
||||
public Transform pin; // The hitting point as in the animation
|
||||
|
||||
void LateUpdate() {
|
||||
// Rotate the aim Transform to look at the point, where the fist hits its target in the animation.
|
||||
// This will set the animated hit direction as the default starting point for Aim IK (direction for which Aim IK has to do nothing).
|
||||
aimIK.solver.transform.LookAt(pin.position);
|
||||
|
||||
// Set myself as IK target
|
||||
aimIK.solver.IKPosition = transform.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66452eca044e1420e9e9bd2945a6bad7
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace RootMotion.Demos {
|
||||
|
||||
public class AimSwing : MonoBehaviour {
|
||||
|
||||
public AimIK ik;
|
||||
[Tooltip("The direction in which the weapon is aimed in animation (in character space). Tweak this value to adjust the aiming.")] public Vector3 animatedAimDirection = Vector3.forward;
|
||||
|
||||
void LateUpdate () {
|
||||
ik.solver.axis = ik.solver.transform.InverseTransformVector(ik.transform.rotation * animatedAimDirection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ccef35d59367884b8f5847c819438b4
|
||||
timeCreated: 1494334657
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace RootMotion.Demos
|
||||
{
|
||||
// Using LimbIK on the left arm to put the left hand back to where it was relative to the right hand before solving AimIK on the spine and right arm bones.
|
||||
public class SecondHandOnGun : MonoBehaviour
|
||||
{
|
||||
public AimIK aim;
|
||||
public LimbIK leftArmIK;
|
||||
public Transform leftHand, rightHand;
|
||||
public GrounderFBBIK grounder;
|
||||
|
||||
public Vector3 leftHandPositionOffset;
|
||||
public Vector3 leftHandRotationOffset;
|
||||
|
||||
private Vector3 leftHandPosRelToRight;
|
||||
private Quaternion leftHandRotRelToRight;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Disable the IK components to take control over the updating of their solvers
|
||||
aim.enabled = false;
|
||||
leftArmIK.enabled = false;
|
||||
if (grounder != null) grounder.ik.enabled = false;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
// Store the position and rotation of the left hand relative to the right as animated
|
||||
leftHandPosRelToRight = rightHand.InverseTransformPoint(leftHand.position);
|
||||
leftHandRotRelToRight = Quaternion.Inverse(rightHand.rotation) * leftHand.rotation;
|
||||
|
||||
// Update FBBIK for grounding
|
||||
if (grounder != null) grounder.ik.solver.Update();
|
||||
|
||||
// Update AimIK
|
||||
aim.solver.Update();
|
||||
|
||||
// AimIK has moved the right arm, so the hand hand needs to be put back to how it was relative to the right hand (the inverse of the above)
|
||||
leftArmIK.solver.IKPosition = rightHand.TransformPoint(leftHandPosRelToRight + leftHandPositionOffset);
|
||||
leftArmIK.solver.IKRotation = rightHand.rotation * Quaternion.Euler(leftHandRotationOffset) * leftHandRotRelToRight;
|
||||
|
||||
// Update Left arm IK (we don't want another FBBIK pass, LimbIK is much faster)
|
||||
leftArmIK.solver.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 197630ec716e8f54d8547033d33eb8ad
|
||||
timeCreated: 1535372901
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,93 @@
|
||||
using RootMotion.Demos;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace RootMotion.Demos {
|
||||
|
||||
// Demonstrating 360-degree aiming system built with 6 static aiming poses and AimIK.
|
||||
public class SimpleAimingSystem : MonoBehaviour {
|
||||
|
||||
[Tooltip("AimPoser is a tool that returns an animation name based on direction.")]
|
||||
public AimPoser aimPoser;
|
||||
|
||||
[Tooltip("Reference to the AimIK component.")]
|
||||
public AimIK aim;
|
||||
|
||||
[Tooltip("Reference to the LookAt component (only used for the head in this instance).")]
|
||||
public LookAtIK lookAt;
|
||||
|
||||
[Tooltip("Reference to the Animator component.")]
|
||||
public Animator animator;
|
||||
|
||||
[Tooltip("Time of cross-fading from pose to pose.")]
|
||||
public float crossfadeTime = 0.2f;
|
||||
|
||||
[Tooltip("Will keep the aim target at a distance.")]
|
||||
public float minAimDistance = 0.5f;
|
||||
|
||||
private AimPoser.Pose aimPose, lastPose;
|
||||
|
||||
void Start() {
|
||||
// Disable IK components to manage their updating order
|
||||
aim.enabled = false;
|
||||
lookAt.enabled = false;
|
||||
}
|
||||
|
||||
// LateUpdate is called once per frame
|
||||
void LateUpdate () {
|
||||
// Switch aim poses (Legacy animation)
|
||||
Pose();
|
||||
|
||||
// Update IK solvers
|
||||
aim.solver.Update();
|
||||
if (lookAt != null) lookAt.solver.Update();
|
||||
}
|
||||
|
||||
private void Pose() {
|
||||
// Make sure aiming target is not too close (might make the solver instable when the target is closer to the first bone than the last bone is).
|
||||
LimitAimTarget();
|
||||
|
||||
// Get the aiming direction
|
||||
Vector3 direction = (aim.solver.IKPosition - aim.solver.bones[0].transform.position);
|
||||
// Getting the direction relative to the root transform
|
||||
Vector3 localDirection = transform.InverseTransformDirection(direction);
|
||||
|
||||
// Get the Pose from AimPoser
|
||||
aimPose = aimPoser.GetPose(localDirection);
|
||||
|
||||
// If the Pose has changed
|
||||
if (aimPose != lastPose) {
|
||||
// Increase the angle buffer of the pose so we won't switch back too soon if the direction changes a bit
|
||||
aimPoser.SetPoseActive(aimPose);
|
||||
|
||||
// Store the pose so we know if it changes
|
||||
lastPose = aimPose;
|
||||
}
|
||||
|
||||
// Direct blending
|
||||
foreach (AimPoser.Pose pose in aimPoser.poses) {
|
||||
if (pose == aimPose) {
|
||||
DirectCrossFade(pose.name, 1f);
|
||||
} else {
|
||||
DirectCrossFade(pose.name, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure aiming target is not too close (might make the solver instable when the target is closer to the first bone than the last bone is).
|
||||
void LimitAimTarget() {
|
||||
Vector3 aimFrom = aim.solver.bones[0].transform.position;
|
||||
Vector3 direction = (aim.solver.IKPosition - aimFrom);
|
||||
direction = direction.normalized * Mathf.Max(direction.magnitude, minAimDistance);
|
||||
|
||||
aim.solver.IKPosition = aimFrom + direction;
|
||||
}
|
||||
|
||||
// Uses Mecanim's Direct blend trees for cross-fading
|
||||
private void DirectCrossFade(string state, float target) {
|
||||
float f = Mathf.MoveTowards(animator.GetFloat(state), target, Time.deltaTime * (1f / crossfadeTime));
|
||||
animator.SetFloat(state, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80dd97a5e7b214f88860e8a63328b1e3
|
||||
timeCreated: 1433754666
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace RootMotion.Demos {
|
||||
|
||||
/// <summary>
|
||||
/// Raycasting to the ground to redirect upper-body animation based on ground topography.
|
||||
/// </summary>
|
||||
public class TerrainOffset : MonoBehaviour {
|
||||
|
||||
public AimIK aimIK; // Reference to the AimIK component
|
||||
public Vector3 raycastOffset = new Vector3(0f, 2f, 1.5f); // Offset from the character, in local space, to raycast from
|
||||
public LayerMask raycastLayers; // The layers we want to raycast at
|
||||
public float min = -2f, max = 2f; // Min and max for the offset
|
||||
public float lerpSpeed = 10f; // The speed of lerping the IKPosition to make things nice and smooth
|
||||
|
||||
private RaycastHit hit;
|
||||
private Vector3 offset;
|
||||
|
||||
void LateUpdate() {
|
||||
// Find the raycastOffset in world space
|
||||
Vector3 worldOffset = transform.rotation * raycastOffset;
|
||||
|
||||
// Find how much higher is the ground at worldOffset relative to the character position.
|
||||
Vector3 realOffset = GetGroundHeightOffset(transform.position + worldOffset);
|
||||
|
||||
// Smoothly lerp the offset value so it would not jump on sudden raycast changes
|
||||
offset = Vector3.Lerp(offset, realOffset, Time.deltaTime * lerpSpeed);
|
||||
|
||||
// The default offset point at the character's height
|
||||
Vector3 zeroOffsetPosition = transform.position + new Vector3(worldOffset.x, 0f, worldOffset.z);
|
||||
|
||||
// Make the Aim Transform look at the default offset point (So when we are on planar ground there will be nothing for Aim IK to do)
|
||||
aimIK.solver.transform.LookAt(zeroOffsetPosition);
|
||||
|
||||
// Make Aim IK bend the spine by the offset.
|
||||
aimIK.solver.IKPosition = zeroOffsetPosition + offset;
|
||||
}
|
||||
|
||||
private Vector3 GetGroundHeightOffset(Vector3 worldPosition) {
|
||||
// Visualize the raycast
|
||||
Debug.DrawRay(worldPosition, Vector3.down * raycastOffset.y * 2f, Color.green);
|
||||
|
||||
// Raycast to find how much higher is the ground at worldPosition relative to the character.
|
||||
if (Physics.Raycast(worldPosition, Vector3.down, out hit, raycastOffset.y * 2f)) {
|
||||
return Mathf.Clamp(hit.point.y - transform.position.y, min, max) * Vector3.up;
|
||||
}
|
||||
|
||||
// Raycast found nothing so return zero
|
||||
return Vector3.zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7c5ddaa57a724f7baa46a4196fd27ee
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76a7b3578da45e14fbb46967d1abd801
|
||||
timeCreated: 1535372912
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2686
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Terrain Offset.unity
Normal file
2686
Assets/Plugins/RootMotion/FinalIK/_DEMOS/Aim IK/Terrain Offset.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 625128834590c457595556a63cd0d2fc
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user