void Dead() { isDead = true; EnemyAttck attck = GetComponent <EnemyAttck>(); attck.onlyOnce = 0; nameOfTheToten = name; anime.SetTrigger("IsDead"); theCactussWasMurdered = true; StartCoroutine(WaitAndDie()); }
void Awake() { anime = GetComponent <Animator>(); health = GetComponent <EnemyHealthScript>(); audioSource = GetComponent <AudioSource>(); player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealth>(); SetDefaultPosAndRot(); xPosition = transform.position.x + DistanceToMove; moveSpeedAnime = 0; //a = player.transform.position; enemyAttck = this; canMoveEnemyWithDelay = false; }