public void CreateFormation(BattleFormationSaveData formationSaveData)
    {
        Units = new List <FormationUnit>();
        foreach (var unitSaveData in formationSaveData.unitData)
        {
            if (unitSaveData.IsHero)
            {
                Hero hero = DarkestDungeonManager.Campaign.Heroes.Find(estateHero =>
                                                                       estateHero.RosterId == unitSaveData.RosterId);
                FormationUnit unit = Instantiate(Resources.Load <GameObject>("Prefabs/Heroes/" +
                                                                             hero.Class)).GetComponent <FormationUnit>();
                unit.transform.SetParent(transform, false);
                unit.Party = this;
                unit.Initialize(hero, unitSaveData);
                Units.Add(unit);
                unit.ResetAnimations();

                if (hero.HeroClass.Modes.Count > 0)
                {
                    var currentMode = hero.HeroClass.Modes.Find(mode => mode.Id == unitSaveData.CurrentMode);
                    if (currentMode != null)
                    {
                        hero.CurrentMode = currentMode;
                    }
                    else
                    {
                        hero.CurrentMode = hero.HeroClass.Modes.Find(mode => mode.IsRaidDefault);
                    }
                }
            }
            else
            {
                GameObject unitObject = unitSaveData.IsCorpse ?
                                        Resources.Load("Prefabs/Monsters/" + unitSaveData.OriginalClass) as GameObject :
                                        Resources.Load("Prefabs/Monsters/" + unitSaveData.Class) as GameObject;
                FormationUnit unit = Instantiate(unitObject).GetComponent <FormationUnit>();
                unit.transform.SetParent(transform, false);
                unit.Party = this;
                var monsterSave = new Monster(unitSaveData);
                unit.Initialize(monsterSave, unitSaveData);
                Units.Add(unit);
                unit.ResetAnimations();
                if (unitSaveData.IsCorpse)
                {
                    unit.SetInstantCorpseAnimation();
                }
            }
        }
    }