RiftMayhem/Assets/Scripts/SetCharacter.cs

23 lines
545 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SetCharacter : MonoBehaviour
{
[SerializeField] private StringSharedField characterName;
[SerializeField] private List<GameObject> highlights = new List<GameObject>();
public void SelectCharacter(string value)
{
characterName.Value = value;
}
public void HighlightSelected(int index)
{
for (int i = 0; i < highlights.Count; i++)
{
highlights[i].SetActive(i == index);
}
}
}