예제 #1
0
    public void SetCharacter(CharacterScriptableObject charObject)
    {
        character       = charObject;
        nameHeader.text = charObject.name;
        portrait.sprite = charObject.portrait;

        for (int i = 0; i < charObject.attacks.Length; i++)
        {
            AttackScript attackLabel = Instantiate <AttackScript>(attackPrefab);
            attackLabel.transform.parent        = transform;
            attackLabel.transform.localPosition = attackPosition + Vector3.down * attackSpacing * i;
            attackLabel.transform.localRotation = Quaternion.identity;

            attackLabel.SetAttack(i, charObject.attacks[i]);
        }
    }