public override void init() { scrollControer0 = new ScrollControler(); scrollControer0.create(getComponentByPath <ScrollRect>("con_page/view")); instan = this; inText(); achModel = A3_AchievementModel.getInstance(); conTypeTab = this.getTransformByPath("con_tab"); conPage = this.getTransformByPath("con_page/view/con"); tempPage = this.getGameObjectByPath("con_page/tempPage"); textPoint = this.getComponentByPath <Text>("Text_point/Text_point"); // btnUpgrade = new BaseButton(this.getTransformByPath("btn_upgrade")); //btnUpgrade.onClick = OnUpgradeClick; btnLeft = new BaseButton(this.getTransformByPath("btn_select/btn_left")); btnLeft.onClick = OnLeftClick; btnRight = new BaseButton(this.getTransformByPath("btn_select/btn_right")); btnRight.onClick = OnRightClick; textPageIndex = this.getComponentByPath <Text>("btn_select/bg/Text"); btnClose = new BaseButton(this.getTransformByPath("btn_close")); btnClose.onClick = OnCloseClick; scrollPage = this.getComponentByPath <ScrollRect>("con_page/view"); //TODO 初始化页面内容 InitBtnTab(); base.init(); }
public override void onClosed() { BaseProxy <A3_RankProxy> .getInstance().removeEventListener(0u, new Action <GameEvent>(this.OnRefreshPageEvent)); BaseProxy <A3_RankProxy> .getInstance().removeEventListener(1u, new Action <GameEvent>(this.OnShowGetPrize)); BaseProxy <A3_RankProxy> .getInstance().removeEventListener(2u, new Action <GameEvent>(this.OnRefreshPageEvent)); A3_AchievementModel expr_4F = this.achModel; expr_4F.OnAchievementChange = (Action)Delegate.Remove(expr_4F.OnAchievementChange, new Action(this.OnPointChange)); this.ClearContainer(); this.scrollPage.StopMovement(); base.onClosed(); }
public override void onShowed() { BaseProxy <A3_RankProxy> .getInstance().addEventListener(0u, new Action <GameEvent>(this.OnRefreshPageEvent)); BaseProxy <A3_RankProxy> .getInstance().addEventListener(1u, new Action <GameEvent>(this.OnShowGetPrize)); BaseProxy <A3_RankProxy> .getInstance().addEventListener(2u, new Action <GameEvent>(this.OnRefreshPageEvent)); A3_AchievementModel expr_4F = this.achModel; expr_4F.OnAchievementChange = (Action)Delegate.Combine(expr_4F.OnAchievementChange, new Action(this.OnPointChange)); this.OnPointChange(); this.OnShowAchievementPage(this.selectType, this.pageIndex); base.onShowed(); }
public override void init() { this.achModel = ModelBase <A3_AchievementModel> .getInstance(); this.conTypeTab = base.getTransformByPath("con_tab"); this.conPage = base.getTransformByPath("con_page/view/con"); this.tempPage = base.getGameObjectByPath("con_page/tempPage"); this.textPoint = base.getComponentByPath <Text>("Text_point/Text_point"); this.btnLeft = new BaseButton(base.getTransformByPath("btn_select/btn_left"), 1, 1); this.btnLeft.onClick = new Action <GameObject>(this.OnLeftClick); this.btnRight = new BaseButton(base.getTransformByPath("btn_select/btn_right"), 1, 1); this.btnRight.onClick = new Action <GameObject>(this.OnRightClick); this.textPageIndex = base.getComponentByPath <Text>("btn_select/bg/Text"); this.btnClose = new BaseButton(base.getTransformByPath("btn_close"), 1, 1); this.btnClose.onClick = new Action <GameObject>(this.OnCloseClick); this.scrollPage = base.getComponentByPath <ScrollRect>("con_page/view"); this.InitBtnTab(); base.init(); }
public void onLoadinfos(Variant data) { debug.Log("s2c_rank_achievement_::" + data.dump()); int res = data["res"]; if (res < 0) { Globle.err_output(res); return; } switch (res) { case 1: A3_AchievementModel.getInstance().SyncAchievementDataByServer(data); dispatchEvent(GameEvent.Create(RANKREFRESH, this, data)); break; case 2: A3_AchievementModel.getInstance().OnAchievementChangeFromServer(data); dispatchEvent(GameEvent.Create(ON_ACHIEVEMENT_CHANGE, this, data)); break; case 3: break; case 4: //获得成就奖励 A3_AchievementModel.getInstance().OnGetAchievePrize(data); if (data.ContainsKey("ach_point")) { PlayerModel.getInstance().ach_point = data["ach_point"]; a3_RankModel.nowexp = data["ach_point"]; A3_AchievementModel.getInstance().AchievementPoint = data["ach_point"]; dispatchEvent(GameEvent.Create(RANKREFRESH, this, data)); } dispatchEvent(GameEvent.Create(ON_GET_ACHIEVEMENT_PRIZE, this, data)); break; case 5: debug.Log("升级成功:" + data["title"]); if (data.ContainsKey("title")) { PlayerModel.getInstance().titileChange(data); a3_RankModel.getInstance().refreinfo(data["title"], a3_RankModel.nowexp); if (data.ContainsKey("ach_point")) { PlayerModel.getInstance().ach_point = data["ach_point"]; a3_RankModel.nowexp = data["ach_point"]; A3_AchievementModel.getInstance().AchievementPoint = data["ach_point"]; dispatchEvent(GameEvent.Create(RANKREFRESH, this, data)); } dispatchEvent(GameEvent.Create(RANKADDLV, this, data)); } break; case 6: debug.Log("显示或者隐藏:" + data["title_display"]._bool); PlayerModel.getInstance().titleShoworHide(data); break; case 7: //成就变化数组 A3_AchievementModel.getInstance().OnAchievementReachChange(data); dispatchEvent(GameEvent.Create(ON_REACH_ACHIEVEMENT, this, data)); break; default: Globle.err_output(data["res"]); break; } ; if (data.ContainsKey("ach_point")) { PlayerModel.getInstance().ach_point = data["ach_point"]; A3_AchievementModel.getInstance().AchievementPoint = data["ach_point"]; a3_RankModel.nowexp = data["ach_point"]; } }