备份CatanBuilding瘦身独立工程

This commit is contained in:
JSD\13999
2026-05-26 16:15:54 +08:00
commit 2d0e6a61b7
12001 changed files with 2431925 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
using asap.core;
using game;
using System;
using TMPro;
using UniRx;
using UnityEngine;
public class ReportBase : MonoBehaviour
{
TMP_Text text_name;
Head head;
IUserService userService;
IDisposable disposable;
string playFabId;
protected virtual void Awake()
{
userService = GContext.container.Resolve<IUserService>();
disposable = GContext.OnEvent<GetClubPlayInfoEvent>().Where(x => x.id == playFabId).Subscribe(SetAvatar);
text_name = transform.Find("info/text_name")?.GetComponent<TMP_Text>();
head = transform.Find("btn_head").GetComponent<Head>();
}
public void Init(string playFabId)
{
this.playFabId = playFabId;
PlayInfo clubPlayInfo = userService.GetPlayInfo(playFabId);
SetAvatar(clubPlayInfo);
}
void SetAvatar(PlayInfo clubPlayInfo)
{
if (clubPlayInfo != null)
{
if (text_name != null)
{
text_name.text = clubPlayInfo.name;
}
head.SetData(clubPlayInfo.avatarUrl);
}
}
void SetAvatar(GetClubPlayInfoEvent getClubPlayInfoEvent)
{
if (getClubPlayInfoEvent.id == playFabId)
{
text_name.text = getClubPlayInfoEvent.name;
head.SetData(getClubPlayInfoEvent.avatarUrl);
}
}
private void OnDestroy()
{
disposable?.Dispose();
disposable = null;
}
}