RiftMayhem/Assets/Scripts/UI/CharacterListScreenAnim.cs
Pedro Gomes 410e28e046 Player account update
- Added Player account data with list of characters
- Added character selection scene
- Loading and saving characters flow working with account names as filters
2024-07-17 11:59:51 +01:00

42 lines
967 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterListScreenAnim : MonoBehaviour
{
public StringSharedField selectedCharacterName;
public List<GameObject> characters;
private void Start()
{
for (int i = 0; i < characters.Count; i++)
{
characters[i].SetActive(false);
}
}
public void UpdateClassIcon(string characterClass)
{
for (int i = 0; i < characters.Count; i++)
{
if (characterClass.Contains(characters[i].name))
{
characters[i].SetActive(true);
}
else
{
characters[i].SetActive(false);
}
}
}
private void Update()
{
if (selectedCharacterName == null) return;
if (string.IsNullOrEmpty(selectedCharacterName.Value)) return;
UpdateClassIcon(selectedCharacterName.Value);
}
}