CharSelectionManager.cs 463 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class CharSelectionManager : MonoBehaviour
  5. {
  6. [SerializeField] private GameObject[] characterPrefabs;
  7. public void ChangeCharacter(int index)
  8. {
  9. for (int i = 0; i < characterPrefabs.Length; i++)
  10. {
  11. characterPrefabs[i].SetActive(false);
  12. }
  13. characterPrefabs[index].SetActive(true);
  14. }
  15. void Update()
  16. {
  17. }
  18. }