Reload animation fertig

This commit is contained in:
pbg2h23akl 2024-08-23 11:38:28 +02:00
parent 6273ebc082
commit bf48815336
9 changed files with 499 additions and 16 deletions

View File

@ -0,0 +1,124 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-7529289756165330356
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: IdleGun
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: 5077672945de3b944b4ee3f044ed2c77, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-6482251240475896716
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: -7529289756165330356}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gun
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 6223413485408025700}
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 &6223413485408025700
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: 7088587049564305912}
m_Position: {x: 300, y: 0, z: 0}
- serializedVersion: 1
m_State: {fileID: -7529289756165330356}
m_Position: {x: 300, y: 110, 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: -7529289756165330356}
--- !u!1102 &7088587049564305912
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Reloadanim
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -6482251240475896716}
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: 9148ba273f63c4f44907bd710cbc9026, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

View File

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

View File

@ -6,7 +6,7 @@ AnimationClip:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animation
m_Name: IdleGun
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
@ -36,7 +36,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f1b4db8d6246765468a3ff9b00c4038f
guid: 5077672945de3b944b4ee3f044ed2c77
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000

View File

@ -0,0 +1,249 @@
%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: Reloadanim
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 1, y: 260, z: 7}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.5
value: {x: 1, y: 260, z: -83.495}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 1, y: 260, z: 7}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
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: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
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:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 260
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 260
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 260
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 7
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: -83.495
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 7
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path:
classID: 4
script: {fileID: 0}
flags: 0
m_EulerEditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path:
classID: 4
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []

View File

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

View File

@ -189,6 +189,60 @@ MonoBehaviour:
ySensitivity: 300
cam: {fileID: 689352146329584273}
newDirY: 0
--- !u!1 &3472699153046784061
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7114251324995838674}
- component: {fileID: 7804932218512029869}
m_Layer: 10
m_Name: GunPivotPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7114251324995838674
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3472699153046784061}
serializedVersion: 2
m_LocalRotation: {x: 0.041165236, y: 0.76492906, z: -0.0459122, w: -0.64115614}
m_LocalPosition: {x: 0.351, y: -0.299, z: 0.367}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4163468239720933169}
m_Father: {fileID: 5950832400214244271}
m_LocalEulerAnglesHint: {x: 1, y: 260, z: 7}
--- !u!95 &7804932218512029869
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3472699153046784061}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 4d18ed34e761f394192c900960a419e1, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!1 &6608350815154232110
GameObject:
m_ObjectHideFlags: 0
@ -326,7 +380,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 19647278204217505}
- {fileID: 4163468239720933169}
- {fileID: 7114251324995838674}
- {fileID: 7059315404903924766}
m_Father: {fileID: 4231050703702953731}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -457,53 +511,66 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 5950832400214244271}
m_TransformParent: {fileID: 7114251324995838674}
m_Modifications:
- target: {fileID: 1169450665700565, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: animator
value:
objectReference: {fileID: 7804932218512029869}
- target: {fileID: 1169450665700565, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: reloadTime
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1169450665700565, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: animatorController
value:
objectReference: {fileID: 9100000, guid: 4d18ed34e761f394192c900960a419e1, type: 2}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalPosition.x
value: 0.42874753
value: 0.19000632
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalPosition.y
value: -0.403
value: -0.13011694
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalPosition.z
value: 0.5883101
value: -0.1131641
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalRotation.w
value: -0.64392865
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalRotation.x
value: 0.042799693
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalRotation.y
value: 0.76238793
value: -0.000000029802315
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalRotation.z
value: -0.047841944
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 1.022
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 260.435
value: 260
objectReference: {fileID: 0}
- target: {fileID: 6798321073873421098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 7.29
value: 7
objectReference: {fileID: 0}
- target: {fileID: 8363807481264483936, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
propertyPath: m_Name
value: Gun
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedComponents:
- {fileID: 1244558426216277098, guid: 4d3459d3c81134641b756c0c5205d59e, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []

View File

@ -42,6 +42,7 @@ GameObject:
m_Component:
- component: {fileID: 6798321073873421098}
- component: {fileID: 1169450665700565}
- component: {fileID: 1244558426216277098}
m_Layer: 10
m_Name: Gun
m_TagString: Untagged
@ -85,6 +86,27 @@ MonoBehaviour:
uI_Manager: {fileID: 0}
reloadTime: 3
schussInterval: 0.3
--- !u!95 &1244558426216277098
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8363807481264483936}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 4d18ed34e761f394192c900960a419e1, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!1001 &5945913481014272002
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Animations;
using UnityEngine;
public class WeaponScript : MonoBehaviour
@ -22,9 +23,12 @@ public class WeaponScript : MonoBehaviour
private bool delayOver = true;
public float schussInterval;
private float delay = 0;
public Animator animator;
public void checkReload(){
if(ammo == 0 || Input.GetKeyDown(inputManagerScript.getReload())){
isReloading = true;
animator.Play("Reloadanim");
}
if(isReloading){
time += Time.deltaTime;
@ -33,6 +37,7 @@ public class WeaponScript : MonoBehaviour
uI_Manager.ammoReset();
time = 0;
isReloading = false;
//animator.SetBool("isReloading",false);
}
}
}