Enemy animations working

This commit is contained in:
kimrdd 2024-02-03 21:31:14 +01:00
parent e98baf5b9f
commit 4cccb5218a
4 changed files with 1334 additions and 16 deletions

View File

@ -69,13 +69,13 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Strangle
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -149,7 +149,10 @@ AnimatorStateTransition:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Strangle
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 4778432799953724235}
m_Solo: 0
@ -159,8 +162,8 @@ AnimatorStateTransition:
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
@ -184,7 +187,7 @@ AnimatorStateTransition:
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: dbb100609945c1542badad290ab80bd8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,20 +8,13 @@ public class EnemyAnimationHandler : MonoBehaviour
void Start()
{
animator = GetComponentInChildren<Animator>();
if (animator == animator.enabled)
animator.enabled = false;
if (animator != animator.enabled)
animator.enabled = true;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.F))
Strangle();
if (Input.GetKeyDown(KeyCode.G))
Die();
}
public void Strangle()
{
animator.enabled = true;
animator.SetTrigger("Die");
}
public void Die()
{