Animations!

Animations for walking, running, jumping while running
Improved ground detection
Fixed some character functionality not working above a certain speed
This commit is contained in:
Norbi Peti 2020-11-18 00:11:03 +01:00
parent e0b194d7eb
commit 93de3681f0
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
20 changed files with 1100 additions and 18 deletions

8
Assets/Animations.meta Normal file
View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38ceae954c414f427ae4fa920b225227
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,373 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-8987728897907739601
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: Speed
m_EventTreshold: 0.1
- m_ConditionMode: 6
m_ConditionEvent: Jump
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 2915947465038908738}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
--- !u!1101 &-4624505121643448120
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: Speed
m_EventTreshold: 0.1
- m_ConditionMode: 2
m_ConditionEvent: Sprint
m_EventTreshold: 0
- m_ConditionMode: 6
m_ConditionEvent: Jump
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1544678512520658519}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 0
m_CanTransitionToSelf: 0
--- !u!1102 &-1640697823006375366
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CharacterFall
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: 8f5a80ecc7eac151ea33800135ba8077, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-1544678512520658519
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CharacterWalk
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: c0434a9d917dba6a88867cea38f003a8, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-1163576790731296724
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: Speed
m_EventTreshold: 0.9
- m_ConditionMode: 1
m_ConditionEvent: Sprint
m_EventTreshold: 0
- m_ConditionMode: 6
m_ConditionEvent: Jump
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1306503613525126779}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Character
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Speed
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Sprint
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Jump
m_Type: 3
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 723122302859164095}
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!1107 &723122302859164095
AnimatorStateMachine:
serializedVersion: 5
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: 2915947465038908738}
m_Position: {x: 260, y: 140, z: 0}
- serializedVersion: 1
m_State: {fileID: -1544678512520658519}
m_Position: {x: 520, y: -10, z: 0}
- serializedVersion: 1
m_State: {fileID: 1306503613525126779}
m_Position: {x: 270, y: -90, z: 0}
- serializedVersion: 1
m_State: {fileID: 7822183342188573683}
m_Position: {x: 470, y: 80, z: 0}
- serializedVersion: 1
m_State: {fileID: -1640697823006375366}
m_Position: {x: 530, y: 160, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: -4624505121643448120}
- {fileID: -8987728897907739601}
- {fileID: -1163576790731296724}
- {fileID: 4827319619884786487}
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: 2915947465038908738}
--- !u!1102 &1306503613525126779
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CharacterRun
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: 6ef74ee92b1d2aeeb9ba73f040248c86, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &2915947465038908738
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CharacterStand
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: 9932b64dda35ac26baf8d9a71ae6fa5c, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &4827319619884786487
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 6
m_ConditionEvent: Jump
m_EventTreshold: 1
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7822183342188573683}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
--- !u!1101 &5550797005891240585
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7822183342188573683}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75409836
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &7778810051654835894
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 6
m_ConditionEvent: Jump
m_EventTreshold: 2
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1640697823006375366}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75409836
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &7822183342188573683
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CharacterJump
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 7778810051654835894}
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: f6cafb9f28dbf71caad2b1701d863a18, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8a45d79eff56ac9fe9c8c50b3318a6ed
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,77 @@
%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: CharacterFall
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 3361131043089554334, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.16666667
value: {fileID: -8789370896416366076, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.33333334
value: {fileID: 5728794044653291647, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
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: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 3361131043089554334, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -8789370896416366076, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: 5728794044653291647, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.35000002
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8f5a80ecc7eac151ea33800135ba8077
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,140 @@
%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: CharacterJump
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.33333334
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Gun
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 8959041838961795847, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.16666667
value: {fileID: -2258061119048845259, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.33333334
value: {fileID: 3361131043089554334, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
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: 1926661051
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 8959041838961795847, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -2258061119048845259, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: 3361131043089554334, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.35000002
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.33333334
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Gun
classID: 1
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f6cafb9f28dbf71caad2b1701d863a18
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,85 @@
%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: CharacterRun
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 8959041838961795847, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.25
value: {fileID: -8623413058668782668, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.5
value: {fileID: 5728794044653291647, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.75
value: {fileID: -2258061119048845259, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 1
value: {fileID: 8959041838961795847, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
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: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 8959041838961795847, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -8623413058668782668, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: 5728794044653291647, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -2258061119048845259, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: 8959041838961795847, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.0166667
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: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6ef74ee92b1d2aeeb9ba73f040248c86
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,73 @@
%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: CharacterStand
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 6185353665997233981, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 1
value: {fileID: 6185353665997233981, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
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: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 6185353665997233981, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: 6185353665997233981, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.0166667
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: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9932b64dda35ac26baf8d9a71ae6fa5c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,148 @@
%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: CharacterWalk
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Gun
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: -1989377262933277898, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.25
value: {fileID: -6618872083037343320, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.5
value: {fileID: -3982056006877205448, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 0.75
value: {fileID: 8154732895160588515, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
- time: 1
value: {fileID: -1989377262933277898, guid: 22df4be82d91637658b965dd24a4a591,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
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: 1926661051
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -1989377262933277898, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -6618872083037343320, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -3982056006877205448, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: 8154732895160588515, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
- {fileID: -1989377262933277898, guid: 22df4be82d91637658b965dd24a4a591, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.0166667
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:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Gun
classID: 1
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c0434a9d917dba6a88867cea38f003a8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,5 +1,35 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &4407407046900251487
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1529445790525209946}
m_Layer: 0
m_Name: Foot
m_TagString: Untagged
m_Icon: {fileID: 4422084297763085224, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1529445790525209946
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4407407046900251487}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.049, y: -0.241, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7250562544566202698}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7250562544566202694 --- !u!1 &7250562544566202694
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -30,7 +60,8 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.31, y: 4.27, z: 0} m_LocalPosition: {x: -0.31, y: 4.27, z: 0}
m_LocalScale: {x: -1, y: 1, z: 1} m_LocalScale: {x: -1, y: 1, z: 1}
m_Children: [] m_Children:
- {fileID: 1529445790525209946}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -143,6 +174,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a86eb57291c5f566d8b1cb9f87a029d9, type: 3} m_Script: {fileID: 11500000, guid: a86eb57291c5f566d8b1cb9f87a029d9, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
foot: {fileID: 1529445790525209946}
groundRadius: 0.1
groundMask:
serializedVersion: 2
m_Bits: 256
target: {fileID: 0} target: {fileID: 0}
speed: 8 speed: 8
flyForce: 30 flyForce: 30

View file

@ -201,7 +201,7 @@ GameObject:
- component: {fileID: 407879045} - component: {fileID: 407879045}
- component: {fileID: 407879044} - component: {fileID: 407879044}
- component: {fileID: 407879046} - component: {fileID: 407879046}
m_Layer: 0 m_Layer: 8
m_Name: PlatformMid m_Name: PlatformMid
m_TagString: Ground m_TagString: Ground
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -309,7 +309,7 @@ GameObject:
- component: {fileID: 413955008} - component: {fileID: 413955008}
- component: {fileID: 413955007} - component: {fileID: 413955007}
- component: {fileID: 413955009} - component: {fileID: 413955009}
m_Layer: 0 m_Layer: 8
m_Name: PlatformRight m_Name: PlatformRight
m_TagString: Ground m_TagString: Ground
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -405,7 +405,8 @@ PolygonCollider2D:
m_AutoTiling: 0 m_AutoTiling: 0
m_Points: m_Points:
m_Paths: m_Paths:
- - {x: -0.35, y: 0.35} - - {x: -0.34868273, y: 0.35010514}
- {x: -0.34908652, y: 0.34994364}
- {x: -0.35, y: -0.35} - {x: -0.35, y: -0.35}
- {x: -0.021993905, y: -0.2905682} - {x: -0.021993905, y: -0.2905682}
- {x: 0.22573361, y: -0.16113642} - {x: 0.22573361, y: -0.16113642}
@ -539,7 +540,7 @@ GameObject:
- component: {fileID: 887921231} - component: {fileID: 887921231}
- component: {fileID: 887921230} - component: {fileID: 887921230}
- component: {fileID: 887921232} - component: {fileID: 887921232}
m_Layer: 0 m_Layer: 8
m_Name: PlatformLeft m_Name: PlatformLeft
m_TagString: Ground m_TagString: Ground
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -642,7 +643,7 @@ PolygonCollider2D:
- {x: -0.15077958, y: -0.21121931} - {x: -0.15077958, y: -0.21121931}
- {x: 0.031678874, y: -0.2983211} - {x: 0.031678874, y: -0.2983211}
- {x: 0.35, y: -0.35} - {x: 0.35, y: -0.35}
- {x: 0.35, y: 0.35} - {x: 0.3502799, y: 0.34996805}
--- !u!1 &996257474 --- !u!1 &996257474
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -756,6 +757,36 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
smoothing: 1 smoothing: 1
--- !u!1 &1005132794
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1005132795}
m_Layer: 0
m_Name: Foot
m_TagString: Untagged
m_Icon: {fileID: 4422084297763085224, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1005132795
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1005132794}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.061, y: -0.221, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2053847422}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1043406433 --- !u!1 &1043406433
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1126,7 +1157,7 @@ GameObject:
- component: {fileID: 1508769556} - component: {fileID: 1508769556}
- component: {fileID: 1508769557} - component: {fileID: 1508769557}
- component: {fileID: 1508769558} - component: {fileID: 1508769558}
m_Layer: 0 m_Layer: 8
m_Name: Ground m_Name: Ground
m_TagString: Ground m_TagString: Ground
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -1381,6 +1412,7 @@ GameObject:
- component: {fileID: 2053847423} - component: {fileID: 2053847423}
- component: {fileID: 2053847425} - component: {fileID: 2053847425}
- component: {fileID: 2053847426} - component: {fileID: 2053847426}
- component: {fileID: 2053847427}
m_Layer: 0 m_Layer: 0
m_Name: Character m_Name: Character
m_TagString: Player m_TagString: Player
@ -1451,6 +1483,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1811013770} - {fileID: 1811013770}
- {fileID: 1005132795}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -1513,9 +1546,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 216ec793de06a4ac7a9767782a179419, type: 3} m_Script: {fileID: 11500000, guid: 216ec793de06a4ac7a9767782a179419, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
foot: {fileID: 1005132795}
groundRadius: 0.1
groundMask:
serializedVersion: 2
m_Bits: 256
jumpForce: 5 jumpForce: 5
movementSpeed: 5 movementSpeed: 2
sprintSpeed: 15 sprintSpeed: 1.5
platformSpawner: {fileID: 219260673} platformSpawner: {fileID: 219260673}
--- !u!114 &2053847426 --- !u!114 &2053847426
MonoBehaviour: MonoBehaviour:
@ -1531,3 +1569,22 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
prefab: {fileID: 6006275050469676560, guid: 7debf3c35b28387fdbec1c1c9942afae, type: 3} prefab: {fileID: 6006275050469676560, guid: 7debf3c35b28387fdbec1c1c9942afae, type: 3}
firePoint: {fileID: 1043406434} firePoint: {fileID: 1043406434}
--- !u!95 &2053847427
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2053847420}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 8a45d79eff56ac9fe9c8c50b3318a6ed, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0

View file

@ -6,10 +6,13 @@ public abstract class CharacterControllerBase : MonoBehaviour
{ {
protected Rigidbody2D _rb; protected Rigidbody2D _rb;
public Transform foot;
public float groundRadius;
public LayerMask groundMask;
public bool IsOnGround(string groundName = "") public bool IsOnGround(string groundName = "")
{ {
var res = new List<Collider2D>(); var collider = Physics2D.OverlapCircle(foot.position, groundRadius, groundMask);
_rb.OverlapCollider(new ContactFilter2D(), res); return collider && (groundName.Length == 0 || collider.name.StartsWith(groundName));
return res.Any(col => col.CompareTag("Ground") && (groundName.Length == 0 || col.name.StartsWith(groundName)));
} }
} }

View file

@ -26,7 +26,7 @@ public class EnemySpawner : MonoBehaviour
private void FixedUpdate() private void FixedUpdate()
{ {
//int timeMultiplier = _spawner.maxLevel - _spawner.Level; //int timeMultiplier = _spawner.maxLevel - _spawner.Level;
int countMultiplier = _spawner.Level; int countMultiplier = _spawner.Level + 1;
if (Time.fixedTime - _lastSpawn > timeBetweenSpawns && _random.Next(2) == 1) if (Time.fixedTime - _lastSpawn > timeBetweenSpawns && _random.Next(2) == 1)
{ {
short count = (short) _random.Next(maxEnemyCount * countMultiplier); short count = (short) _random.Next(maxEnemyCount * countMultiplier);

View file

@ -17,12 +17,18 @@ public class OwnCharacterController : CharacterControllerBase
private readonly Random _random = new Random(); private readonly Random _random = new Random();
private readonly List<Vector3> _checkpointPosList = new List<Vector3>(); private readonly List<Vector3> _checkpointPosList = new List<Vector3>();
private Vector3 _checkpointPos; private Vector3 _checkpointPos;
private Animator _animator;
private static readonly int Speed = Animator.StringToHash("Speed");
private static readonly int Jump = Animator.StringToHash("Jump");
private static readonly int Sprint = Animator.StringToHash("Sprint");
private JumpStatus _jumpStatus = JumpStatus.None;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
_rb = GetComponent<Rigidbody2D>(); _rb = GetComponent<Rigidbody2D>();
_spawnPos = transform.position; _spawnPos = transform.position;
_animator = GetComponent<Animator>();
} }
// Update is called once per frame // Update is called once per frame
@ -30,8 +36,6 @@ public class OwnCharacterController : CharacterControllerBase
{ {
if (platformSpawner.ShouldRespawn(transform, this)) if (platformSpawner.ShouldRespawn(transform, this))
Respawn(); Respawn();
if (Mathf.Abs(_rb.velocity.x) > 3)
return;
float input = Input.GetAxis("Horizontal"); float input = Input.GetAxis("Horizontal");
var tr = transform; var tr = transform;
if (input < 0 && tr.localScale.x > 0 if (input < 0 && tr.localScale.x > 0
@ -44,10 +48,30 @@ public class OwnCharacterController : CharacterControllerBase
if (Input.GetButton("Fire3")) if (Input.GetButton("Fire3"))
input *= sprintSpeed; input *= sprintSpeed;
_rb.AddForce(new Vector2(input * movementSpeed, 0));
if (Mathf.Abs(_rb.velocity.x) <= 3)
_rb.velocity += new Vector2(input * movementSpeed, 0);
if (Input.GetButtonDown("Jump") && IsOnGround()) if (Input.GetButtonDown("Jump") && IsOnGround())
_rb.AddForce(new Vector2(0, jumpForce), ForceMode2D.Impulse); {
//_rb.AddForce(new Vector2(0, jumpForce), ForceMode2D.Impulse);
_rb.velocity += new Vector2(0, jumpForce);
if (Input.GetButton("Fire3")) //Csak akkor animálja az ugrást, ha fut közben
{
_jumpStatus = JumpStatus.Up;
_animator.SetInteger(Jump, (int) _jumpStatus);
}
}
else if (_jumpStatus == JumpStatus.Up && _rb.velocity.y <= 0)
{
_jumpStatus = JumpStatus.Down;
_animator.SetInteger(Jump, (int) _jumpStatus);
}
else if (_jumpStatus == JumpStatus.Down && Math.Abs(_rb.velocity.y) <= 0.001f)
{
_jumpStatus = JumpStatus.None;
_animator.SetInteger(Jump, (int) _jumpStatus);
}
if (_checkpointPos.x > 0 && (tr.position - _checkpointPos).magnitude < 2f) if (_checkpointPos.x > 0 && (tr.position - _checkpointPos).magnitude < 2f)
{ {
@ -55,6 +79,9 @@ public class OwnCharacterController : CharacterControllerBase
_checkpointPosList.RemoveAt(0); _checkpointPosList.RemoveAt(0);
_checkpointPos = _checkpointPosList.Count > 0 ? _checkpointPosList[0] : Vector3.zero; _checkpointPos = _checkpointPosList.Count > 0 ? _checkpointPosList[0] : Vector3.zero;
} }
_animator.SetFloat(Speed, Math.Abs(_rb.velocity.x));
_animator.SetBool(Sprint, Input.GetButton("Fire3"));
} }
public void Hit() public void Hit()
@ -76,4 +103,11 @@ public class OwnCharacterController : CharacterControllerBase
_checkpointPosList.Add(pos); _checkpointPosList.Add(pos);
if (_checkpointPos.x <= 0) _checkpointPos = _checkpointPosList[0]; if (_checkpointPos.x <= 0) _checkpointPos = _checkpointPosList[0];
} }
enum JumpStatus
{
None,
Up,
Down
}
} }

View file

@ -16,7 +16,7 @@ TagManager:
- UI - UI
- -
- -
- - Ground
- -
- -
- -