20 lines
694 B
C#
20 lines
694 B
C#
namespace ET.Client
|
|
{
|
|
[MessageHandler(SceneType.Main)]
|
|
[FriendOf(typeof(GachaComponent))]
|
|
public class Gacha_GachaInfoHandler : MessageHandler<Scene, Gacha_GachaInfo>
|
|
{
|
|
protected override async ETTask Run(Scene scene, Gacha_GachaInfo message)
|
|
{
|
|
GachaComponent component = scene.GetComponent<GachaComponent>() ?? scene.AddComponent<GachaComponent>();
|
|
foreach (GachaPoolStats stat in message.stats)
|
|
{
|
|
component.Stats[stat.poolId] = stat;
|
|
EventSystem.Instance.Publish(scene, new GachaUpdatedEvent { PoolId = stat.poolId });
|
|
}
|
|
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
}
|