ошибки поворота, прицела

This commit is contained in:
lapich committed 2026-10-21 13:34:22 +03:00
1 parent 202a894140
commit da648df1d9
200 files changed
+31969 -629

No files matched your search

+32 -2
View File
@@ -30,8 +30,38 @@ public class MutantHealth : MonoBehaviour
if (currentHealth <= 0)
{
Debug.Log("МУТАНТ УМЕР!");
Destroy(gameObject);
Die();
}
}
private void Die()
{
Debug.Log("МУТАНТ УМЕР!");
var anim = GetComponentInChildren<Animator>();
if (anim != null)
{
anim.SetBool("IsDead", true);
anim.SetTrigger("Die");
}
if (mutantAI != null)
{
mutantAI.enabled = false;
}
var agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
if (agent != null)
{
agent.isStopped = true;
agent.enabled = false;
}
var col = GetComponent<Collider>();
if (col != null)
{
col.enabled = false;
}
Destroy(gameObject, 3.5f);
}
}