Ciro Continisio
4 年前
当前提交
e3f6f31a
共有 12 个文件被更改,包括 2446 次插入 和 7 次删除
-
110UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef.controller
-
2UOP1_Project/Assets/ScriptableObjects/StateMachine/Protagonist/Actions/MoveInTheAir.asset
-
2UOP1_Project/Assets/ScriptableObjects/StateMachine/Protagonist/Actions/MoveOnTheGround.asset
-
1UOP1_Project/Assets/ScriptableObjects/StateMachine/Protagonist/States/Walking.asset
-
1001UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_faint.fbx
-
129UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_faint.fbx.meta
-
1001UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_run.fbx
-
129UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_run.fbx.meta
-
15UOP1_Project/Assets/ScriptableObjects/StateMachine/Protagonist/Actions/AnimatorMoveSpeedAction.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachine/Protagonist/Actions/AnimatorMoveSpeedAction.asset.meta
-
44UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/AnimatorMoveSpeedActionSO.cs
-
11UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/AnimatorMoveSpeedActionSO.cs.meta
1001
UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_faint.fbx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 8c5d2f78dc797944db3531962c5d18ce |
|||
ModelImporter: |
|||
serializedVersion: 19301 |
|||
internalIDToNameTable: |
|||
- first: |
|||
74: 6434412210229332969 |
|||
second: faint |
|||
externalObjects: {} |
|||
materials: |
|||
materialImportMode: 0 |
|||
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: |
|||
- serializedVersion: 16 |
|||
name: faint |
|||
takeName: faint |
|||
internalID: 0 |
|||
firstFrame: 1 |
|||
lastFrame: 71 |
|||
wrapMode: 0 |
|||
orientationOffsetY: 0 |
|||
level: 0 |
|||
cycleOffset: 0 |
|||
loop: 0 |
|||
hasAdditiveReferencePose: 0 |
|||
loopTime: 0 |
|||
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: 1 |
|||
useFileUnits: 1 |
|||
keepQuads: 0 |
|||
weldVertices: 1 |
|||
preserveHierarchy: 0 |
|||
skinWeightsMode: 0 |
|||
maxBonesPerVertex: 4 |
|||
minBoneWeight: 0.001 |
|||
meshOptimizationFlags: -1 |
|||
indexFormat: 0 |
|||
secondaryUVAngleDistortion: 8 |
|||
secondaryUVAreaDistortion: 15 |
|||
secondaryUVHardAngle: 88 |
|||
secondaryUVPackMargin: 8 |
|||
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 |
|||
additionalBone: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_run.fbx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 1da1da422bdf1a54788013b6f1edbd45 |
|||
ModelImporter: |
|||
serializedVersion: 19301 |
|||
internalIDToNameTable: |
|||
- first: |
|||
74: 6200578666267062213 |
|||
second: run |
|||
externalObjects: {} |
|||
materials: |
|||
materialImportMode: 0 |
|||
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: |
|||
- serializedVersion: 16 |
|||
name: run |
|||
takeName: run |
|||
internalID: 0 |
|||
firstFrame: 1 |
|||
lastFrame: 20 |
|||
wrapMode: 0 |
|||
orientationOffsetY: 0 |
|||
level: 0 |
|||
cycleOffset: 0.5 |
|||
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 |
|||
preserveHierarchy: 0 |
|||
skinWeightsMode: 0 |
|||
maxBonesPerVertex: 4 |
|||
minBoneWeight: 0.001 |
|||
meshOptimizationFlags: -1 |
|||
indexFormat: 0 |
|||
secondaryUVAngleDistortion: 8 |
|||
secondaryUVAreaDistortion: 15 |
|||
secondaryUVHardAngle: 88 |
|||
secondaryUVPackMargin: 8 |
|||
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 |
|||
additionalBone: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 89b354c39b5e27d4b974ab1569e800b8, type: 3} |
|||
m_Name: AnimatorMoveSpeedAction |
|||
m_EditorClassIdentifier: |
|||
parameterName: MovingSpeed |
|
|||
fileFormatVersion: 2 |
|||
guid: 5aac41c53e47f1040a52303b2000ceb5 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEngine; |
|||
using UOP1.StateMachine; |
|||
using UOP1.StateMachine.ScriptableObjects; |
|||
using Moment = UOP1.StateMachine.StateAction.SpecificMoment; |
|||
|
|||
/// <summary>
|
|||
/// Flexible StateActionSO for the StateMachine which allows to set any parameter on the Animator, in any moment of the state (OnStateEnter, OnStateExit, or each OnUpdate).
|
|||
/// </summary>
|
|||
[CreateAssetMenu(fileName = "AnimatorMoveSpeedAction", menuName = "State Machines/Actions/Set Animator Move Speed")] |
|||
public class AnimatorMoveSpeedActionSO : StateActionSO |
|||
{ |
|||
public string parameterName = default; |
|||
|
|||
protected override StateAction CreateAction() => new AnimatorMoveSpeedAction(Animator.StringToHash(parameterName)); |
|||
} |
|||
|
|||
public class AnimatorMoveSpeedAction : StateAction |
|||
{ |
|||
//Component references
|
|||
private Animator _animator; |
|||
private Protagonist _protagonist; |
|||
|
|||
private AnimatorParameterActionSO _originSO => (AnimatorParameterActionSO)base.OriginSO; // The SO this StateAction spawned from
|
|||
private int _parameterHash; |
|||
|
|||
public AnimatorMoveSpeedAction(int parameterHash) |
|||
{ |
|||
_parameterHash = parameterHash; |
|||
} |
|||
|
|||
public override void Awake(StateMachine stateMachine) |
|||
{ |
|||
_animator = stateMachine.GetComponent<Animator>(); |
|||
_protagonist = stateMachine.GetComponent<Protagonist>(); |
|||
} |
|||
|
|||
public override void OnUpdate() |
|||
{ |
|||
//TODO: do we like that we're using the magnitude here, per frame? Can this be done in a smarter way?
|
|||
float normalisedSpeed = _protagonist.movementInput.magnitude; |
|||
_animator.SetFloat(_parameterHash, normalisedSpeed); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 89b354c39b5e27d4b974ab1569e800b8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue