Commit 18251186 authored by LasseKau's avatar LasseKau
Browse files

riflefix

---
parent 242ef0dd
......@@ -193,28 +193,6 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-7996986912128048482
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: -5482110616314920844}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-7769323914923748210
AnimatorStateTransition:
m_ObjectHideFlags: 1
......@@ -402,7 +380,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadCasing
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 4217282943305792707}
......@@ -511,7 +489,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadBoolet
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 8571243207561811657}
......@@ -771,7 +749,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadBoolet
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 8571243207561811657}
......@@ -990,7 +968,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadOuterBolt
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5482110616314920844}
......@@ -1006,6 +984,31 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-1217485592951905488
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5482110616314920844}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.8314607
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-818755497440866368
AnimatorState:
serializedVersion: 5
......@@ -1104,37 +1107,43 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: ReloadBoolet
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: ReloadCasing
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: ReloadOuterBolt
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: ReloadInnerBolt
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Firing
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Reloading
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Stock&Body
......@@ -1299,7 +1308,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadInnerBolt
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6096306848564933100}
......@@ -1324,7 +1333,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadStock
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -8202910867048764138}
......@@ -1475,7 +1484,7 @@ AnimatorState:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New State
m_Speed: 10
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 6758670782132101706}
......@@ -1702,7 +1711,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadInnerBolt
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6096306848564933100}
......@@ -1821,7 +1830,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadCasing
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 4217282943305792707}
......@@ -1975,7 +1984,7 @@ AnimatorStateTransition:
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
......@@ -2066,8 +2075,8 @@ AnimatorState:
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -7996986912128048482}
- {fileID: -2043199353479258589}
- {fileID: -1217485592951905488}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
......@@ -2093,7 +2102,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: ReloadStock
m_ConditionEvent: Reloading
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -8202910867048764138}
......
......@@ -91,8 +91,7 @@ public class Rifle : MonoBehaviour
if (Input.GetKeyDown("r") && loadedAmmo < Magazine && ammo > 0)
{
StartCoroutine(Reloading());
reloadAnim();
anim.SetBool("Reloading", true);
}
if (Input.GetButton("Fire2") && !isReloading)
......@@ -138,6 +137,7 @@ public class Rifle : MonoBehaviour
Debug.Log("Rifle reload ended");
// anim.ResetTrigger("Reloading");
isReloading = false;
anim.SetBool("Reloading", false);
}
void Shoot()
......@@ -217,11 +217,5 @@ public class Rifle : MonoBehaviour
anim.SetTrigger("Firing");
}
public void reloadAnim()
{
anim.SetTrigger("ReloadStock");
anim.SetTrigger("ReloadBoolet");
anim.SetTrigger("ReloadCasing");
anim.SetTrigger("ReloadOuterBolt");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment