| | |
| | | public class GuildEmblemModel : GameSystemManager<GuildEmblemModel>
|
| | | {
|
| | |
|
| | | public Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction> emblemActions = new Dictionary<int, HA513_tagMCFamilyActionInfo.tagMCFamilyAction>();
|
| | |
|
| | |
|
| | | private int m_NowChooseEmblemId;
|
| | |
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;
|
| | | GuildManager.Instance.FamilyActionInfoEvent += OnFamilyActionInfoEvent;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | GuildManager.Instance.EnterOrQuitGuildEvent += OnEnterOrQuitGuildEvent;
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyInfo;
|
| | | GuildManager.Instance.FamilyActionInfoEvent -= OnFamilyActionInfoEvent;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | GuildManager.Instance.EnterOrQuitGuildEvent -= OnEnterOrQuitGuildEvent;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | createEmblemWord = "";
|
| | | oldShowActiveList.Clear();
|
| | | showList.Clear();
|
| | | emblemActions.Clear();
|
| | | }
|
| | |
|
| | | public void OnEnterOrQuitGuildEvent(bool isEnter)
|
| | | {
|
| | | OnBeforePlayerDataInitialize();
|
| | | }
|
| | |
|
| | | private void OnRefreshFairyInfo()
|
| | |
| | | }
|
| | |
|
| | |
|
| | | void OnFamilyActionInfoEvent(int familyId, int actionType)
|
| | | {
|
| | | UpdateRedPoint();
|
| | | }
|
| | |
|
| | | public bool IsLimitTime(int emblemId, out HA513_tagMCFamilyActionInfo.tagMCFamilyAction familyAction)
|
| | | {
|
| | | familyAction = new HA513_tagMCFamilyActionInfo.tagMCFamilyAction();
|
| | |
| | | return PlayerDatas.Instance.fairyData.mine.FmLV == 3;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | // 更新徽章信息
|
| | | public bool UpdateEmblemAction(HA513_tagMCFamilyActionInfo _package)
|
| | | {
|
| | | if (_package.ActionType != GuildManager.FamilyActionsType)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < _package.FamilyActionList.Length; i++)
|
| | | {
|
| | | int emblemId = (int)_package.FamilyActionList[i].Value1;
|
| | | emblemActions[emblemId] = _package.FamilyActionList[i];
|
| | | }
|
| | |
|
| | | |
| | | UpdateRedPoint();
|
| | | return true;
|
| | | }
|
| | |
|
| | | // 获得徽章记录信息信息(活动途径获取的徽章,定制徽章),value1是徽章ID,value2是徽章到期时间
|
| | | private bool TryGetfamilyAction(int emblemId, out HA513_tagMCFamilyActionInfo.tagMCFamilyAction familyAction)
|
| | | {
|
| | | familyAction = new HA513_tagMCFamilyActionInfo.tagMCFamilyAction();
|
| | | if (GuildManager.Instance.TryGetFamilyActions(GuildManager.FamilyActionsType, out var actions))
|
| | | if (emblemActions.TryGetValue(emblemId, out familyAction))
|
| | | {
|
| | | for (int i = 0; i < actions.Length; i++)
|
| | | {
|
| | | if (actions[i].Value1 == emblemId)
|
| | | {
|
| | | familyAction = actions[i];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | return false;
|