private void setupDeathScreen() { //Set up text characterName.text = Player.instance.firstName + " " + Player.instance.lastName; player.setSpriteController(Player.instance.getSpriteController()); causeOfDeath.text = Player.instance.causeOfDeath; //Set up revenge Target CMoveCombatable newRevengeTarget = Player.instance.getAttacker(); revengeTarget.setSpriteController(newRevengeTarget.getSpriteController()); //Set up name revengeName.text = Player.instance.getAttacker().getName(); //Setup class revengeClass.text = newRevengeTarget.getClass().name; //set up faction revengeFaction.text = newRevengeTarget.faction.ToString(); revengeStats[0].text = "Level: " + newRevengeTarget.level; revengeStats[1].text = "Strength: " + newRevengeTarget.getStats()[0]; revengeStats[2].text = "Agility: " + newRevengeTarget.getStats()[1]; revengeStats[3].text = "Endurance: " + newRevengeTarget.getStats()[2]; for (int i = 0; i < 4; i++) { revengeStatChanges[i].text = "+" + newRevengeTarget.levelupChanges[i]; } revengeAbilities[0].sprite = newRevengeTarget.getClass().abilities[0].getIcon(); revengeAbilities[1].sprite = newRevengeTarget.getClass().abilities[1].getIcon(); }
//Returns a random sprite[] public RuntimeAnimatorController getSpriteController(CMoveCombatable character) { RuntimeAnimatorController[] spriteControllers; //If class is null if (character.getClass() == null) { character.chooseRandomClass(); } switch (character.faction) { case (Faction.Player): spriteControllers = playerControllers; break; case (Faction.None): spriteControllers = NPCControllers; break; default: if (character.getClass().name == "Sharpshooter") { spriteControllers = shooterControllers; } else { spriteControllers = duelistControllers; } break; } int spriteSet = Random.Range(0, spriteControllers.Length); //Will never be 2 return(spriteControllers[spriteSet]); }