private IEnumerator EndFight() { // Interrupting animation if running animationRunning = false; // Setting mob to defeated defeated = true; // Setting next turn to player's turn and deactivating buttons fightManager.currentTurn = FightManager.Turn.Player; fightManager.ButtonsActive(false); // Playing mob's death animation gameObject.GetComponent <Animator>().Play(gameObject.name + "_Dead"); yield return(new WaitForSeconds(2f)); // Mob now dead dead = true; // Send delegate if (onPlayerDefeatMob != null) { onPlayerDefeatMob(); } // Add food to player inventory inventoryManager.AddItemToInventory(dropItem, Random.Range(0, 4)); // Fight is ended fightManager.CanFight(false); ResetForNextFight(); // Resetting fightManager.ActivateFakeMobs(); // Activating animated models for attacks Destroy(gameObject); // Mob is destroyed }