enemy animations not done

This commit is contained in:
kimrdd 2024-02-04 00:08:25 +01:00
parent 1ad0336c54
commit 23c33488dd
20 changed files with 36 additions and 235 deletions

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -172,19 +172,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: -4060921817738925561}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -256,19 +256,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1169561095041589923}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -173,19 +173,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -173,19 +173,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -173,19 +173,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -257,19 +257,7 @@ MonoBehaviour:
maxHealth: 100
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2938081276856164938}
m_TargetAssemblyTypeName: HealthComponent, Assembly-CSharp
m_MethodName: SimpleKill
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
OnHealthChange:
m_PersistentCalls:
m_Calls: []

View File

@ -11,7 +11,23 @@ public class EnemyAnimationHandler : MonoBehaviour
if (animator != animator.enabled)
animator.enabled = true;
GetComponent<HealthComponent>().OnHealthZero.AddListener(EnemyDie);
}
void EnemyDie()
{
StartCoroutine(AnimationDie());
}
IEnumerator AnimationDie()
{
Strangle();
yield return new WaitForSecondsRealtime(1f);
Die();
while (animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1f)
yield return new WaitForEndOfFrame();
Destroy(gameObject);
}
public void Strangle()
{
animator.SetTrigger("Die");
@ -19,5 +35,6 @@ public class EnemyAnimationHandler : MonoBehaviour
public void Die()
{
animator.SetTrigger("Die");
}
}

View File

@ -51,7 +51,7 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
TakeDamage((int) Mathf.Round(squezeDamage * squezeDamageScalor));
}
public void SimpleKill()
public void EnemyKill()
{
Destroy(gameObject);
}