public override void OnInit() { base.OnInit(); AddPropChangedNotify((int)MVCPropertyID.enStageMenu, OnPropertyChanged); //AddPropChangedNotify((int)MVCPropertyID.enSceneManager, OnPropertySceneChanged); m_inputCamp = FindChildComponent <UIInput>("IntCamp"); m_inputKey = FindChildComponent <UIInput>("EnterCode"); m_isRolling = FindChildComponent <UIToggle>("Toggle_effects"); m_level = FindChildComponent <UILabel>("Level"); m_name = FindChildComponent <UILabel>("ZoneName"); // m_floorItem = FindChildComponent<UIDragScrollView>("FloorItem"); // m_stageItem = FindChildComponent<UIDragScrollView>("StageItem"); m_itemList = new List <UIStageMenuStageItem>(); m_floorItemList = new List <UIStageMenuFloorItem>(); m_grid = FindChildComponent <UILabel>("StageGrid"); // m_mainTips = FindChildComponent<UILabel>("MainTips"); // m_deputyTips = FindChildComponent<UILabel>("DeputyTips"); // m_supportTips = FindChildComponent<UILabel>("SupportTips"); // m_comradeTips = FindChildComponent<UILabel>("ComradeTips"); m_battlePreparation = FindChildComponent <UISprite>("BattlePreparation"); m_battleBtn = FindChildComponent <UIButton>("Battle"); // m_teamItem = FindChildComponent<UILabel>("Item"); // m_noMainTips = FindChildComponent<UILabel>("NoMainTips"); m_expText = FindChildComponent <UILabel>("ExpText"); m_expBar = FindChildComponent <UIProgressBar>("ExpBar"); m_staminaText = FindChildComponent <UILabel>("StaminaText"); m_staminaBar = FindChildComponent <UIProgressBar>("StaminaBar"); m_staminaTimingText = FindChildComponent <UILabel>("TiminglText"); m_levelText = FindChildComponent <UILabel>("LevelText"); m_helper = FindChildComponent <UIPanel>("Helper"); m_helperItem = FindChildComponent <UIToggle>("HelperItem"); m_helpGrid = FindChildComponent <UIGrid>("HelperGrid"); m_helperCardName = FindChildComponent <UILabel>("HelperCardName"); m_helperCardLevel = FindChildComponent <UILabel>("HelperLevel"); m_helperCardRace = FindChildComponent <UILabel>("HelperRace"); m_helperCardOcc = FindChildComponent <UILabel>("HelperOcc"); m_helperPhyAttack = FindChildComponent <UILabel>("HelperPhyAttack"); m_helperMagAttack = FindChildComponent <UILabel>("HelperMagAttack"); m_helperHP = FindChildComponent <UILabel>("HelperHP"); m_helperModelFather = FindChildComponent <UILabel>("HelpModel"); m_heleperBar = FindChildComponent <UIProgressBar>("HelperBar"); UIStageMenuTeamItem item = UIStageMenuTeamItem.Create(); item.SetParent(m_battlePreparation.transform); m_teamList.Add(0, item); }
// 显示更新 战斗准备 void UpdateBattlePreparation() { for (int i = 0; i < Team.Singleton.TeamNum; ++i) { if (false == m_teamList.ContainsKey(i)) { UIStageMenuTeamItem item = UIStageMenuTeamItem.Create(); item.SetParent(m_battlePreparation.transform); m_teamList.Add(i, item); } } int curTeamIndex = Team.Singleton.m_curTeamIndex; foreach (KeyValuePair <int, UIStageMenuTeamItem> item in m_teamList) { if (item.Key == curTeamIndex) { item.Value.ShowWindow(); } else { item.Value.HideWindow(); } } HideAllModel(); if (!m_teamList.ContainsKey(curTeamIndex)) { Team.Singleton.m_curTeamIndex = 0; curTeamIndex = 0; } UIStageMenuTeamItem teamItem = m_teamList[curTeamIndex]; teamItem.ShowWindow(); AddModel(Team.Singleton.GetCard(curTeamIndex, Team.EDITTYPE.enMain), teamItem.m_mainModelObj); AddModel(Team.Singleton.GetCard(curTeamIndex, Team.EDITTYPE.enDeputy), teamItem.m_deputyModelObj); AddModel(Team.Singleton.GetCard(curTeamIndex, Team.EDITTYPE.enSupport), teamItem.m_supportModelObj); AddModel(Team.Singleton.Comrade, teamItem.m_comradeModelObj); UILabel mainTips = teamItem.m_mainTips; UILabel deputyTips = teamItem.m_deputyTips; UILabel supportTips = teamItem.m_supportTips; UILabel comradeTips = teamItem.m_comradeTips; HeroInfo info = null; CSItem csItem = null; csItem = Team.Singleton.Chief; // 主角色 if (null != csItem) { m_battleBtn.isEnabled = true; info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable); if (null != info) { OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); if (null != occupationInfo) { mainTips.text = Localization.Get("CardLevel") + csItem.Level + "\n"; mainTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n"; mainTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n"; mainTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n"; mainTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n"; mainTips.text += Localization.Get("Def:") + csItem.GetPhyDefend(); } } teamItem.m_noMainTipsLab.SetActive(false); } // 没有主角色 不可以进行战斗 else { m_battleBtn.isEnabled = false; teamItem.m_noMainTipsLab.SetActive(true); } csItem = Team.Singleton.Deputy; // 副角色 if (null != csItem) { info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable); if (null != info) { OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); if (null != occupationInfo) { deputyTips.text = Localization.Get("CardLevel") + csItem.Level + "\n"; deputyTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n"; deputyTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n"; deputyTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n"; deputyTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n"; deputyTips.text += Localization.Get("Def:") + csItem.GetPhyDefend(); } } } csItem = Team.Singleton.Support; // 支援角色 if (null != csItem) { info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable); if (null != info) { OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); if (null != occupationInfo) { supportTips.text = Localization.Get("CardLevel") + csItem.Level + "\n"; supportTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n"; supportTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n"; supportTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n"; supportTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n"; supportTips.text += Localization.Get("Def:") + csItem.GetPhyDefend(); } } } csItem = Team.Singleton.Comrade; // 战友 if (null != csItem) { info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable); if (null != info) { OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); if (null != occupationInfo) { comradeTips.text = Localization.Get("CardLevel") + csItem.Level + "\n"; comradeTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n"; comradeTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n"; comradeTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n"; comradeTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n"; comradeTips.text += Localization.Get("Def:") + csItem.GetPhyDefend(); } } } // TweenPosition temp = m_battlePreparation.gameObject.transform.GetComponent<TweenPosition>(); // if (null == temp) // { // return; // } // // Vector3 posV = m_battlePreparation.gameObject.transform.localPosition; // posV.x = 0; // // TweenPosition.Begin(m_battlePreparation.gameObject, 0.5f, posV).method = UITweener.Method.EaseIn; // temp = m_battleBtn.gameObject.transform.GetComponent<TweenPosition>(); // if (null == temp) // { // return; // } // // posV = m_battleBtn.gameObject.transform.localPosition; // posV.x = 330; // // TweenPosition.Begin(m_battleBtn.gameObject, 0.5f, posV).method = UITweener.Method.EaseIn; //m_battlePreparation.gameObject.SetActive(true); m_battleBtn.gameObject.SetActive(true); m_level.gameObject.SetActive(false); TweenPosition temp = m_name.gameObject.transform.GetComponent <TweenPosition>(); if (null == temp) { return; } Vector3 posV = m_name.gameObject.transform.localPosition; posV.x = -700; TweenPosition.Begin(m_name.gameObject, 0.5f, posV).method = UITweener.Method.EaseIn; m_curType = (int)CurType.enBattleType; }
static public UIStageMenuTeamItem Create() { UIStageMenuTeamItem self = UIManager.Singleton.LoadUI <UIStageMenuTeamItem>("UI/UIStageMenuTeamItem", UIManager.Anchor.Center); return(self); }