77 lines
1.8 KiB
C#
77 lines
1.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace TcgEngine
|
|
{
|
|
[System.Serializable]
|
|
public enum TeamTitle
|
|
{
|
|
Neutral,
|
|
Light,
|
|
Dark,
|
|
Fire,
|
|
Wind,
|
|
Water
|
|
}
|
|
|
|
public static class TeamTitleData
|
|
{
|
|
public static string Team(TeamTitle title)
|
|
{
|
|
switch (title)
|
|
{
|
|
case TeamTitle.Dark:
|
|
return "dark";
|
|
break;
|
|
case TeamTitle.Fire:
|
|
return "fire";
|
|
break;
|
|
case TeamTitle.Light:
|
|
return "light";
|
|
break;
|
|
case TeamTitle.Water:
|
|
return "water";
|
|
break;
|
|
case TeamTitle.Wind:
|
|
return "wind";
|
|
break;
|
|
default:
|
|
return "neutral";
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
[CreateAssetMenu(fileName = "TeamData", menuName = "TcgEngine/TeamData", order = 1)]
|
|
public class TeamData : ScriptableObject
|
|
{
|
|
public TeamTitle id;
|
|
public string title;
|
|
public Sprite icon;
|
|
public Color color;
|
|
|
|
public static List<TeamData> team_list = new List<TeamData>();
|
|
|
|
public static void Load(string folder = "")
|
|
{
|
|
if (team_list.Count == 0)
|
|
team_list.AddRange(Resources.LoadAll<TeamData>(folder));
|
|
}
|
|
|
|
public static TeamData Get(string id)
|
|
{
|
|
foreach (TeamData team in GetAll())
|
|
{
|
|
if (TeamTitleData.Team(team.id) == id)
|
|
return team;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static List<TeamData> GetAll()
|
|
{
|
|
return team_list;
|
|
}
|
|
}
|
|
} |