- Added Player account data with list of characters - Added character selection scene - Loading and saving characters flow working with account names as filters
42 lines
967 B
C#
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);
|
|
}
|
|
}
|