using System.Collections.Generic;
|
using UnityEngine.UI;
|
using System.Linq;
|
using LitJson;
|
using System;
|
|
// 历练秘笈
|
public class ExpSecretCollectionManager : GameSystemManager<ExpSecretCollectionManager>
|
{
|
public int ctgID;
|
|
public byte m_MJLV; // 秘笈等级,激活后从1开始
|
public uint m_Zhanchui; // 秘笈累计消耗战锤
|
public uint m_ExpEx; // 秘笈今日已额外获得经验
|
public uint m_DecomposeEx; // 秘笈今日已额外获得分解货币
|
|
public event Action UpdateExpSecretCollectionEvent;
|
|
public override void Init()
|
{
|
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
var config = FuncConfigConfig.Get("LLMJ");
|
ctgID = int.Parse(config.Numerical1);
|
}
|
|
public override void Release()
|
{
|
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
}
|
|
void OnBeforePlayerDataInitialize()
|
{
|
m_MJLV = 0;
|
m_Zhanchui = 0;
|
m_ExpEx = 0;
|
m_DecomposeEx = 0;
|
}
|
|
public void OnExpSecretCollection(HB128_tagSCLLMJInfo netPack)
|
{
|
m_MJLV = netPack.MJLV;
|
m_Zhanchui = netPack.Zhanchui;
|
m_ExpEx = netPack.ExpEx;
|
m_DecomposeEx = netPack.DecomposeEx;
|
UpdateExpSecretCollectionEvent?.Invoke();
|
UpdateRedpoint();
|
}
|
|
public Redpoint redPointLLMJ = new Redpoint(MainRedDot.RightFuncRedpoint, MainRedDot.RedPoint_LLMJKey);
|
void UpdateRedpoint()
|
{
|
if (m_MJLV == 0) return;
|
var nextConfig = LLMJConfig.Get(m_MJLV + 1);
|
if (nextConfig == null) return;
|
if (m_Zhanchui >= nextConfig.CostWarhammer)
|
{
|
redPointLLMJ.state = RedPointState.Simple;
|
}
|
else
|
{
|
redPointLLMJ.state = RedPointState.None;
|
}
|
}
|
}
|
|