enemy animations not done
This commit is contained in:
parent
1ad0336c54
commit
23c33488dd
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
|
|||
TakeDamage((int) Mathf.Round(squezeDamage * squezeDamageScalor));
|
||||
}
|
||||
|
||||
public void SimpleKill()
|
||||
public void EnemyKill()
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue