/// <summary> /// Update character model mesh, missing code for update item icon also. /// Then update Stats text and Attribute text /// The other missing part is text to show stat of the unit. /// </summary> public void UpdateChar() { //update the mesh model first BasePlayerCharacter tempChar = SquadManager.Instance.focusedUnit; for (int i = 1; i < 6; i++) { characterModel.GetChild(i).GetComponent <SkinnedMeshRenderer>().sharedMesh = tempChar.transform.GetChild(i).GetComponent <SkinnedMeshRenderer>().sharedMesh; } //update the Equipment icon //this need to work on. //Update stat text characterStatsText.text = ""; for (int i = 0; i < 5; i++) { characterStatsText.text += SquadManager.Instance.focusedUnit.CharacterStats.StatsName(i).ToString() + " :" + SquadManager.Instance.focusedUnit.CharacterStats.StatValue(i).ToString() + "\n"; } //Update attribute text characterAttributeText.text = ""; for (int i = 0; i < 12; i++) { characterAttributeText.text += SquadManager.Instance.focusedUnit.CharacterStats.AttributeName(i).ToString() + " :" + SquadManager.Instance.focusedUnit.CharacterStats.AttributeValue(i).ToString() + "\n"; } }
void Start() { playerCharacter = (BasePlayerCharacter)this.GetComponent <PlayerGuardian>(); for (int i = 0; i < 6; i++) { listMesh.Add(transform.GetChild(i + 1)); } charBlock = FindObjectOfType <MenuManager>(); }
void SwitchFocusCharacter() { int i = playerCharacterList.IndexOf(focusedUnit); if (i == playerCharacterList.Count - 1) { focusedUnit = playerCharacterList[0]; } else { focusedUnit = playerCharacterList[++i]; } FocusCharacterChanged(); // if (playerCharacterList.Count > 1) { // Debug.Log("repopulate inventory for charID :" + playerCharacterList.IndexOf (focusedUnit).ToString()); // // } }
/// <summary> /// Sets the unit info. set name, level of the unit. in future. we can set to spawn point, or saved location. /// </summary> /// <param name="currentUnit">Current unit.</param> /// <param name="index">Index.</param> public void SetUnitInfo(BasePlayerCharacter currentUnit, int index) { currentUnit.CharacterName = charList[index].charName; currentUnit.charLevel = charList[index].charLevel; }