37 lines
929 B
C#
37 lines
929 B
C#
using CSNetwork.Protocols.RPCData;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using BrewMonster;
|
|
|
|
namespace BrewMonster.UI
|
|
{
|
|
public class SelecScreenCharacter : MonoBehaviour
|
|
{
|
|
[SerializeField] private GameObject characterItemPrefab;
|
|
[SerializeField] private RectTransform parentItems;
|
|
|
|
public void InitScreen(List<RoleInfo> roleInfos, Action<RoleInfo> OnClickItemChar)
|
|
{
|
|
#if UNITY_EDITOR
|
|
int count = roleInfos.Count;
|
|
#endif
|
|
|
|
foreach (RoleInfo info in roleInfos)
|
|
{
|
|
CharacterItemUI item = Instantiate(characterItemPrefab, parentItems).GetComponent<CharacterItemUI>();
|
|
item.InitItem(info, OnClickItemChar);
|
|
|
|
#if UNITY_EDITOR
|
|
count--;
|
|
if (count <= 0)
|
|
{
|
|
item.OnClickBtn();
|
|
}
|
|
#endif
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|