Exemplo n.º 1
0
    /// <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";
        }
    }
Exemplo n.º 2
0
 void Start()
 {
     playerCharacter = (BasePlayerCharacter)this.GetComponent <PlayerGuardian>();
     for (int i = 0; i < 6; i++)
     {
         listMesh.Add(transform.GetChild(i + 1));
     }
     charBlock = FindObjectOfType <MenuManager>();
 }
Exemplo n.º 3
0
    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());
//
//		}
    }
Exemplo n.º 4
0
 /// <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;
 }