using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
namespace Snxxz.UI
|
{
|
[XLua.LuaCallCSharp]
|
[XLua.Hotfix]
|
public class AllianceBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
{
|
public const int DATAMAPID = 31260;
|
public bool isActivityOver { get; private set; }
|
public int participateLimit { get; private set; }
|
|
public List<Item> inspireRewards { get; private set; }
|
|
public event Action allianceBossStateRefresh;
|
|
public override void Init()
|
{
|
ParseConfig();
|
}
|
|
public void OnBeforePlayerDataInitialize()
|
{
|
isActivityOver = false;
|
}
|
|
public void OnPlayerLoginOk()
|
{
|
}
|
|
public override void UnInit()
|
{
|
}
|
|
void ParseConfig()
|
{
|
var config = FuncConfigConfig.Get("LeagueBOSSNumber1");
|
participateLimit = int.Parse(config.Numerical1);
|
|
inspireRewards = new List<Item>();
|
config = FuncConfigConfig.Get("LeagueBOSSReward1");
|
var itemArray = LitJson.JsonMapper.ToObject<int[][]>(config.Numerical1);
|
for (int i = 0; i < itemArray.Length; i++)
|
{
|
var item = itemArray[i];
|
inspireRewards.Add(new Item()
|
{
|
id = item[0],
|
count = item[1],
|
});
|
}
|
}
|
|
public void ReceivePackage(HA40C_tagGCAllFamilyBossInfo package)
|
{
|
isActivityOver = package.IsEnd == 1;
|
if (allianceBossStateRefresh != null)
|
{
|
allianceBossStateRefresh();
|
}
|
}
|
}
|
}
|
|