public ICharacter CreateCharacter(string characterName) { ISoldier soldier = null; string assetName = ""; switch (characterName) { case "Captain": assetName = "Captain"; break; case "Captive": assetName = "Captive"; break; case "Rookie": assetName = "Rookie"; break; case "Sergeant": assetName = "Sergeant"; break; } IAssetsFactory resoureLoadFactory = new ResouresLoadFactory(); GameObject GO = resoureLoadFactory.LoadSoldier(assetName); switch (characterName) { case "Captain": soldier = new SoldierCaptain(); break; case "Captive": soldier = new SoldierCaptive(); break; case "Rookie": soldier = new SoldierRookie(); break; case "Sergeant": soldier = new SoldierSergeant(); break; } return(soldier); }
public ICharacter CreateCharacter(string characterName) { IEnemy enemy = null; string assetName = ""; switch (characterName) { case "Elf": assetName = "Elf"; break; case "Ogre": assetName = "Ogre"; break; case "Troll": assetName = "Troll"; break; } IAssetsFactory resoureLoadFactory = new ResouresLoadFactory(); GameObject GO = resoureLoadFactory.LoadSoldier(assetName); switch (characterName) { case "Elf": enemy = new EnemyElf(); break; case "Ogre": enemy = new EnemyOgre(); break; case "Troll": enemy = new EnemyTroll(); break; } return(enemy); }