public void changeInformation(int id) { charData = characterList[id].GetComponent <selectedCharacter>().data; characterNameTMP.text = charData.characterName; characterAbilityOneDesc.text = charData.abilities[0].description; characterAbilityTwoDesc.text = charData.abilities[1].description; characterAbilityThreeDesc.text = charData.abilities[2].description; abilityOneSprite.sprite = charData.abilities[0].aSprite; abilityTwoSprite.sprite = charData.abilities[1].aSprite; abilityThreeSprite.sprite = charData.abilities[2].aSprite; }
// Use this for initialization void Start() { if (manager == null) { DontDestroyOnLoad(gameObject); manager = this; } else if (manager != this) { Destroy(gameObject); } }
void Start() { characterList = new GameObject[transform.childCount]; for (int i = 0; i < transform.childCount; i++) { characterList[i] = transform.GetChild(i).gameObject; } foreach (GameObject go in characterList) { go.SetActive(false); } if (characterList[0]) { characterList[0].SetActive(true); charData = characterList[0].GetComponent <selectedCharacter>().data; changeInformation(0); Debug.Log(charData.characterName); } }
public RuntimeCharacter(ICharacterData characterData, IPlayer player) => SetData(characterData, player);