示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (pcClass == null)
        {
            pcClass = GameObject.Find("pc").GetComponent <PlayerCharacter>();
        }

        if (Input.GetKeyUp(KeyCode.G))
        {
            AddItem(ItemGenerator.CreateChest());
        }
        if (_displayCharacterWindow)
        {
            statsInfo.transform.GetChild(0).GetComponent <Text>().text = "Stats:\n\n";
            for (int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++)
            {
                statsInfo.transform.GetChild(0).GetComponent <Text>().text += ((AttributeName)cnt).ToString() + ":  " + pcClass.GetPrimaryAttribute(cnt).AdjustedBaseValue.ToString() + "\n";
            }
        }
    }