| | |
| | | case WrapMode.PingPong: |
| | | t = Mathf.PingPong((accumulatedTime / duration) * curveLength, 1); |
| | | break; |
| | | case WrapMode.PingPongOnce: |
| | | t = Mathf.PingPong((accumulatedTime / (duration/2)) * curveLength, 1); |
| | | break; |
| | | } |
| | | |
| | | var value = curve.Evaluate(reversal ? curveLength - t : t); |
| | |
| | | switch (wrapMode) |
| | | { |
| | | case WrapMode.Once: |
| | | if (t > curveLength && doTween) |
| | | case WrapMode.PingPongOnce: |
| | | if (accumulatedTime > duration && doTween) |
| | | { |
| | | OnOnceEnd(); |
| | | doTween = false; |
| | |
| | | |
| | | protected virtual void OnOnceEnd() |
| | | { |
| | | if (wrapMode == WrapMode.PingPongOnce) |
| | | { |
| | | SetStartState(); |
| | | } |
| | | else |
| | | { |
| | | canvasGroup.alpha = reversal ? from : to; |
| | | } |
| | | |
| | | |
| | | if (onPlayEndCallBack != null) |
| | | { |
| | | onPlayEndCallBack(); |
| | |
| | | Once, |
| | | Loop, |
| | | PingPong, |
| | | PingPongOnce, |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | public static bool CanAwake(int heroID, int awakeLv) |
| | | { |
| | | return GetHeroAwakeConfig(heroID, awakeLv) == null; |
| | | return GetHeroAwakeConfig(heroID, awakeLv) != null; |
| | | } |
| | | |
| | | public static int GetAwakeLVByUnLockGiftIndex(int heroID, int index) |
| | |
| | | { |
| | | |
| | | // Quality, Dictionary<AwakeLV, UPCostItem> |
| | | public static Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>> costDics = new Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>>(); |
| | | static Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>> costDics = new Dictionary<int, Dictionary<int, HeroQualityAwakeConfig>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | |
| | | if (!costDics.TryGetValue(Quality, out tempDic)) |
| | | { |
| | | tempDic = new Dictionary<int, HeroQualityAwakeConfig>(); |
| | | costDics.Add(Quality, tempDic); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | public SkillEffectType effectType; |
| | | |
| | | //技能类型:技能等级:技能 |
| | | static Dictionary<int, Dictionary<int, SkillConfig>> skillDics = new Dictionary<int, Dictionary<int, SkillConfig>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | base.OnConfigParseCompleted(); |
| | |
| | | // } |
| | | // } |
| | | // #endif |
| | | |
| | | Dictionary<int, SkillConfig> tempDic = null; |
| | | if (!skillDics.TryGetValue((int)skillType, out tempDic)) |
| | | { |
| | | tempDic = new Dictionary<int, SkillConfig>(); |
| | | skillDics.Add((int)skillType, tempDic); |
| | | } |
| | | tempDic[SkillLV] = this; |
| | | } |
| | | |
| | | public MotionName GetMotionName() |
| | | { |
| | | return Enum.Parse<MotionName>(SkillMotionName); |
| | | } |
| | | |
| | | public static SkillConfig GetSkillConfig(int skillType, int skillLv) |
| | | { |
| | | Dictionary<int, SkillConfig> tempDic = null; |
| | | if (!skillDics.TryGetValue(skillType, out tempDic)) |
| | | { |
| | | return null; |
| | | } |
| | | SkillConfig config = null; |
| | | tempDic.TryGetValue(skillLv, out config); |
| | | return config; |
| | | } |
| | | } |
| | |
| | | //判断当前是否满星 |
| | | public bool IsFullStar() |
| | | { |
| | | if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null) |
| | | { |
| | | return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper; |
| | | return heroStar >= GetCurMaxStar(); |
| | | } |
| | | |
| | | //当前能达到的最大星级 |
| | | public int GetCurMaxStar() |
| | | { |
| | | if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null) |
| | | { |
| | | return HeroQualityConfig.Get(Quality).InitStarUpper; |
| | | } |
| | | //根据觉醒累计提升星上限 |
| | | int addStarCount = 0; |
| | | for (int i = 1; i <= awakeLevel; i++) |
| | | { |
| | | addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper; |
| | | } |
| | | return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount; |
| | | return HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount; |
| | | } |
| | | |
| | | public bool IsFullGift() |
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | public class HeroAwakeCell : MonoBehaviour |
| | | { |
| | | [SerializeField] UIEffectPlayer fireEffect; |
| | | [SerializeField] Image selectImg; |
| | | [SerializeField] Image bgImg; |
| | | [SerializeField] Image attrTypeImg; |
| | | [SerializeField] Text attrText; |
| | | [SerializeField] UIEffectPlayer activeEffect; |
| | | [SerializeField] Text awakeLVText; |
| | | [SerializeField] Image lineImg; |
| | | |
| | | |
| | | public void Display(HeroInfo hero, int awakeLV) |
| | | { |
| | | var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, awakeLV); |
| | | if (hero.awakeLevel < awakeLV) |
| | | { |
| | | //未激活 |
| | | fireEffect.Stop(); |
| | | selectImg.SetActive(hero.awakeLevel + 1 == awakeLV); |
| | | } |
| | | else |
| | | { |
| | | fireEffect.Play(); |
| | | selectImg.SetActive(false); |
| | | } |
| | | |
| | | //1 天赋 2技能 3属性 |
| | | int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3; |
| | | attrTypeImg.SetSprite("heroattrtype" + type); |
| | | bgImg.SetSprite("heroawakebg" + type); |
| | | if (type == 1) |
| | | { |
| | | attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, Language.Get("HeroAwake4"), false); |
| | | } |
| | | else if (type == 2) |
| | | { |
| | | attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, Language.Get("herocard16"), false); |
| | | } |
| | | else |
| | | { |
| | | string attrStr = ""; |
| | | for (int i = 0; i < config.AttrIDList.Length; i++) |
| | | { |
| | | attrStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[i], config.AttrValueList[i]) + |
| | | (i == config.AttrIDList.Length - 1 ? "" : "\n"); |
| | | } |
| | | attrText.text = UIHelper.AppendColor(hero.awakeLevel >= awakeLV ? TextColType.Green : TextColType.NavyGray, attrStr, false); |
| | | } |
| | | awakeLVText.text = awakeLV.ToString(); |
| | | lineImg.SetActive(hero.awakeLevel >= awakeLV); |
| | | } |
| | | |
| | | public void ShowActiveEffect(HeroInfo hero, int awakeLV) |
| | | { |
| | | var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, awakeLV); |
| | | //1 天赋 2技能 3属性 |
| | | int type = config.UnlockTalentSlot != 0 ? 1 : config.SkillID != 0 ? 2 : 3; |
| | | if (type != 3) |
| | | return; |
| | | |
| | | if (hero.awakeLevel + 1 == awakeLV) |
| | | { |
| | | activeEffect.Play(); |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 87307568b66763849ba8f069d6bbff61 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将觉醒选择天赋界面 |
| | | /// </summary> |
| | | public class HeroAwakeSelectGiftWin : UIBase |
| | | { |
| | | [SerializeField] GameObject[] slectGos; |
| | | [SerializeField] Button[] giftBtns; |
| | | [SerializeField] GiftBaseCell[] giftCells; |
| | | [SerializeField] Text[] skillText; |
| | | [SerializeField] Button okBtn; |
| | | |
| | | int selectIndex = 0; |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.AddListener(SelectGift); |
| | | for (int i = 0; i < giftBtns.Length; i++) |
| | | { |
| | | int index = i; |
| | | giftBtns[i].AddListener(() => |
| | | { |
| | | selectIndex = index; |
| | | Display(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | selectIndex = 0; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid); |
| | | if (hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < giftBtns.Length; i++) |
| | | { |
| | | slectGos[i].SetActive(i == selectIndex); |
| | | if (i < hero.talentAwakeRandomIDList.Count) |
| | | { |
| | | giftCells[i].Init(hero.talentAwakeRandomIDList[i], 1); |
| | | var giftConfig = HeroTalentConfig.Get(hero.talentAwakeRandomIDList[i]); |
| | | skillText[i].text = PlayerPropertyConfig.GetFullDescription(giftConfig.AttrID, giftConfig.AttrValue); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | void SelectGift() |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HeroAwake7"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid); |
| | | if (hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | HeroUIManager.Instance.heroBeforeAwakeGiftIDList = new List<int>(hero.talentIDList); |
| | | HeroUIManager.Instance.heroBeforeAwakeGiftLevelList = new List<int>(hero.talentLvList); |
| | | |
| | | HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse() |
| | | { |
| | | guid = HeroUIManager.Instance.selectAwakeHeroGuid, |
| | | type = HeroFuncType.Awake, |
| | | time = Time.time |
| | | }; |
| | | var pack = new CB234_tagCSHeroAwakeSelectTalent(); |
| | | pack.ItemIndex = (ushort)hero.itemHero.gridIndex; |
| | | pack.SelectIndex = (byte)selectIndex; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | CloseWindow(); |
| | | } |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a904e9bfc7697c647ac4bc89145cb27f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将觉醒成功界面 |
| | | /// </summary> |
| | | public class HeroAwakeSuccessWin : UIBase |
| | | { |
| | | |
| | | [SerializeField] HeroShowBaseCell heroShow; |
| | | [SerializeField] Text beforeAwakeLVText; |
| | | [SerializeField] Text afterAwakeLVText; |
| | | [SerializeField] GameObject skillGo; |
| | | [SerializeField] GameObject talentGo; |
| | | |
| | | //技能 |
| | | [SerializeField] Text beforeSkillText; |
| | | [SerializeField] Text afterSkillText; |
| | | |
| | | //天赋 |
| | | [SerializeField] Text beforeStarText; |
| | | [SerializeField] Text afterStarText; |
| | | [SerializeField] GiftBaseCell[] giftBaseCellArr; |
| | | |
| | | [SerializeField] Button okBtn; |
| | | |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.AddListener(CloseWindow); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | if (string.IsNullOrEmpty(HeroUIManager.Instance.selectAwakeHeroGuid)) |
| | | return; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid); |
| | | if (hero == null) |
| | | return; |
| | | |
| | | heroShow.Init(hero.heroId, hero.SkinID); |
| | | beforeAwakeLVText.text = Language.Get("herocard12", hero.awakeLevel - 1); |
| | | afterAwakeLVText.text = Language.Get("herocard12", hero.awakeLevel); |
| | | |
| | | var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, hero.awakeLevel); |
| | | if (config.UnlockTalentSlot == 0) |
| | | { |
| | | talentGo.SetActive(false); |
| | | skillGo.SetActive(true); |
| | | //技能 |
| | | var skill = SkillConfig.Get(config.SkillID); |
| | | if (skill.SkillLV == 1) |
| | | { |
| | | beforeSkillText.text = Language.Get("HeroAwake6"); |
| | | } |
| | | else |
| | | { |
| | | var beforeSkill = SkillConfig.GetSkillConfig(skill.SkillType, skill.SkillLV - 1); |
| | | beforeSkillText.text = beforeSkill.Description; |
| | | } |
| | | |
| | | afterSkillText.text = skill.Description; |
| | | |
| | | } |
| | | else |
| | | { |
| | | talentGo.SetActive(true); |
| | | skillGo.SetActive(false); |
| | | |
| | | var maxStar = hero.GetCurMaxStar(); |
| | | beforeStarText.text = (maxStar - config.AddStarUpper).ToString(); |
| | | afterStarText.text = maxStar.ToString(); |
| | | //天赋 |
| | | HeroUIManager.Instance.RefreshGiftCell(giftBaseCellArr, hero, HeroUIManager.Instance.heroBeforeAwakeGiftIDList, |
| | | HeroUIManager.Instance.heroBeforeAwakeGiftLevelList); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2ba19268b52375a40852747b77c35768 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将觉醒界面 |
| | | /// </summary> |
| | | public class HeroAwakeWin : UIBase |
| | | { |
| | | [SerializeField] HeroAwakeCell[] heroAwakeCellList; |
| | | [SerializeField] Image itemIcon; |
| | | [SerializeField] Text valueText; |
| | | [SerializeField] Button awakeBtn; |
| | | [SerializeField] Text activeTipText; |
| | | [SerializeField] GameObject fullGo; |
| | | [SerializeField] Button watchBtn; |
| | | [SerializeField] HeroShowBaseCell heroShow; |
| | | [SerializeField] UIAlphaTween alphaTween; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | awakeBtn.AddListener(AwakeHero); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | alphaTween.Stop(); |
| | | HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent; |
| | | } |
| | | |
| | | protected override void OnOpen() |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid); |
| | | if (hero == null) |
| | | { |
| | | return; |
| | | } |
| | | if (hero.talentAwakeRandomIDList.Count > 0) |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroAwakeSelectGiftWin>(); |
| | | } |
| | | } |
| | | |
| | | public void Display() |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid); |
| | | if (hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | heroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel); |
| | | |
| | | |
| | | int maxLV = HeroAwakeConfig.GetMaxAwakeLV(hero.heroId); |
| | | int startLV = hero.awakeLevel == maxLV ? (hero.awakeLevel / 6 - 1) * 6 + 1 : hero.awakeLevel / 6 * 6 + 1; |
| | | |
| | | for (int i = 0; i < heroAwakeCellList.Length; i++) |
| | | { |
| | | heroAwakeCellList[i].Display(hero, startLV + i); |
| | | } |
| | | |
| | | if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel) |
| | | { |
| | | awakeBtn.SetActive(false); |
| | | activeTipText.SetActive(true); |
| | | fullGo.SetActive(false); |
| | | |
| | | activeTipText.text = Language.Get("HeroAwake5", hero.heroStar, HeroUIManager.Instance.canWashStarLevel); |
| | | } |
| | | else if (hero.awakeLevel == HeroAwakeConfig.GetMaxAwakeLV(hero.heroId)) |
| | | { |
| | | awakeBtn.SetActive(false); |
| | | fullGo.SetActive(true); |
| | | activeTipText.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | awakeBtn.SetActive(true); |
| | | activeTipText.SetActive(false); |
| | | fullGo.SetActive(false); |
| | | |
| | | var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel); |
| | | int itemID = config.UPCostItem[0]; |
| | | int useCount = config.UPCostItem[1]; |
| | | |
| | | itemIcon.SetItemSprite(itemID); |
| | | valueText.text = UIHelper.ShowUseItem(PackType.Item, itemID, useCount); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | void AwakeHero() |
| | | { |
| | | var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectAwakeHeroGuid); |
| | | if (hero == null) |
| | | { |
| | | return; |
| | | } |
| | | var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel); |
| | | if (config.UPCostItem.IsNullOrEmpty()) |
| | | return; |
| | | |
| | | int itemID = config.UPCostItem[0]; |
| | | int useCount = config.UPCostItem[1]; |
| | | |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, itemID, useCount, 2)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (hero.talentAwakeRandomIDList.Count > 0) |
| | | { |
| | | //防范未选择天赋 |
| | | UIManager.Instance.OpenWindow<HeroAwakeSelectGiftWin>(); |
| | | return; |
| | | } |
| | | |
| | | var pack = new CB233_tagCSHeroAwake(); |
| | | pack.ItemIndex = (ushort)hero.itemHero.gridIndex; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | |
| | | var nextConfig = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, hero.awakeLevel + 1); |
| | | if (nextConfig.UnlockTalentSlot > 0 || nextConfig.SkillID > 0) |
| | | { |
| | | //设置个等待回复的标识 显示成功界面;技能强化显示成功界面,天赋先显示选择界面再显示成功界面 |
| | | HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse() |
| | | { |
| | | guid = HeroUIManager.Instance.selectAwakeHeroGuid, |
| | | type = HeroFuncType.Awake, |
| | | time = Time.time |
| | | }; |
| | | } |
| | | |
| | | //下一格播放特效 |
| | | int startLV = hero.awakeLevel / 6 * 6 + 1; |
| | | heroAwakeCellList[hero.awakeLevel - startLV + 1].ShowActiveEffect(hero, hero.awakeLevel + 1); |
| | | |
| | | //切换轮的时候做个表现 |
| | | if (hero.awakeLevel % 6 == 5) |
| | | { |
| | | alphaTween.Play(); |
| | | } |
| | | } |
| | | |
| | | void OnHeroChangeEvent(HeroInfo hero) |
| | | { |
| | | if (hero.itemHero.guid != HeroUIManager.Instance.selectAwakeHeroGuid) |
| | | { |
| | | return; |
| | | } |
| | | Display(); |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0dd0e19e2e4c00e44ae620f9fe41b4c2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | if (m_StarRect == null) |
| | | { |
| | | m_StarRect = this.transform.Find("Container_HeroShow/layout/stars"); |
| | | m_StarRect = this.transform.Find("Container_HeroShow/layout/layout/stars"); |
| | | } |
| | | return m_StarRect; |
| | | } |
| | |
| | | m_StarsImg = new List<Image>(); |
| | | for (int i = 0; i < 5; i++) |
| | | { |
| | | var star = this.transform.GetComponent<Image>("Container_HeroShow/layout/stars/star" + i); |
| | | var star = this.transform.GetComponent<Image>("Container_HeroShow/layout/layout/stars/star" + i); |
| | | m_StarsImg.Add(star); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (m_Name == null) |
| | | { |
| | | m_Name = this.transform.GetComponent<Text>("Container_HeroShow/name"); |
| | | m_Name = this.transform.GetComponent<Text>("Container_HeroShow/layout/name"); |
| | | } |
| | | return m_Name; |
| | | } |
| | |
| | | { |
| | | if (m_LvText == null) |
| | | { |
| | | m_LvText = this.transform.GetComponent<Text>("Container_HeroShow/layout/lv"); |
| | | m_LvText = this.transform.GetComponent<Text>("Container_HeroShow/layout/layout/lv"); |
| | | } |
| | | return m_LvText; |
| | | } |
| | |
| | | { |
| | | if (m_LvTextOutline == null) |
| | | { |
| | | m_LvTextOutline = this.transform.GetComponent<OutlineEx>("Container_HeroShow/layout/lv"); |
| | | m_LvTextOutline = this.transform.GetComponent<OutlineEx>("Container_HeroShow/layout/layout/lv"); |
| | | } |
| | | return m_LvTextOutline; |
| | | } |
| | |
| | | |
| | | nameText.text = breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, breakLevel); |
| | | nameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality); |
| | | if (lv == 0) |
| | | { |
| | | lvText.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | lvText.SetActive(true); |
| | | lvText.text = string.Format("{0}{1} {2}", Language.Get("L1094"), lv, awakelv == 0 ? Language.Get("herocard13") : Language.Get("herocard12", awakelv)); |
| | | heroLVOutline.colorType = awakelv == 0 ? QualityTextColType.None : QualityTextColType.red; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //缩放到和父rect一样大 |
| | | var scale = 1f; |
| | | var rect = cellContainer.GetComponent<RectTransform>(); |
| | | var parentRect = transform.GetComponent<RectTransform>(); |
| | | float width = parentRect.sizeDelta.x; |
| | | if (width <= 0f) |
| | | { |
| | | //外部控制了尺寸获取为0 |
| | | GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>(); |
| | | if (grid != null) |
| | | { |
| | | width = grid.cellSize.x; |
| | | } |
| | | // var scale = 1f; |
| | | // var rect = cellContainer.GetComponent<RectTransform>(); |
| | | // var parentRect = transform.GetComponent<RectTransform>(); |
| | | // float width = parentRect.sizeDelta.x; |
| | | // if (width <= 0f) |
| | | // { |
| | | // //外部控制了尺寸获取为0 |
| | | // GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>(); |
| | | // if (grid != null) |
| | | // { |
| | | // width = grid.cellSize.x; |
| | | // } |
| | | |
| | | } |
| | | scale = width / rect.sizeDelta.x; |
| | | cellContainer.transform.localScale = cellContainer.transform.localScale * scale; |
| | | // } |
| | | // scale = width / rect.sizeDelta.x; |
| | | // cellContainer.transform.localScale = cellContainer.transform.localScale * scale; |
| | | } |
| | | } |
| | | |
| | |
| | | [SerializeField] Image lvupMoneyIcon; |
| | | [SerializeField] Text lvupMoneyText; |
| | | [SerializeField] Text lvupBtnText; |
| | | [SerializeField] LongPressButton lvupBtn; |
| | | [SerializeField] LongPressButton lvupBtn; //升级 突破 |
| | | [SerializeField] Button allAttrBtn; |
| | | [SerializeField] Text allPotentialText; //潜能 |
| | | [SerializeField] Text[] fetterText; //羁绊 |
| | |
| | | deleteBtn.AddListener(DeleteHero); |
| | | awakeBtn.AddListener(() => |
| | | { |
| | | // UIManager.Instance.OpenWindow<HeroAwakeWin>(hero.heroId); |
| | | HeroUIManager.Instance.selectAwakeHeroGuid = guid; |
| | | UIManager.Instance.OpenWindow<HeroAwakeWin>(); |
| | | }); |
| | | inheritText.OnClick = () => |
| | | { |
| | |
| | | |
| | | void Wash() |
| | | { |
| | | if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel); |
| | | return; |
| | | } |
| | | |
| | | HeroUIManager.Instance.selectWashHeroGUID = hero.itemHero.guid; |
| | | UIManager.Instance.OpenWindow<HeroGiftWashWin>(); |
| | | |
New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | using UnityEngine; |
| | | |
| | | //觉醒 |
| | | public partial class HeroUIManager : GameSystemManager<HeroUIManager> |
| | | { |
| | | public string selectAwakeHeroGuid; |
| | | |
| | | public List<int> heroBeforeAwakeGiftIDList = new List<int>(); //会有重复的ID,不要用字典 |
| | | public List<int> heroBeforeAwakeGiftLevelList = new List<int>(); |
| | | |
| | | } |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 22cea3f17d6c6bd4f9b1fe7c97fb179a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | |
| | | |
| | | //星上限由品质 和 觉醒决定 |
| | | //星最终上限由品质 和 觉醒决定 |
| | | public int GetMaxStarCount(int heroID, int quality) |
| | | { |
| | | if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null) |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroGiftEatSuccessWin>(); |
| | | } |
| | | else if (waitResponse.type == HeroFuncType.Awake) |
| | | { |
| | | var config = HeroAwakeConfig.GetHeroAwakeConfig(hero.heroId, hero.awakeLevel); |
| | | if (hero.talentAwakeRandomIDList.Count > 0) |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroAwakeSelectGiftWin>(); |
| | | } |
| | | else if (config.SkillID != 0 || config.UnlockTalentSlot != 0) |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroAwakeSuccessWin>(); |
| | | } |
| | | } |
| | | waitResponse = default; |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | #region 等待服务端响应 |
| | | public struct WaitHeroFuncResponse |
| | | { |
| | | public HeroFuncType type; |
| | |
| | | None = 0, //无功能 |
| | | Break = 1, //突破 |
| | | Gift = 2, //天赋吞噬 |
| | | |
| | | Awake = 3, //觉醒 |
| | | } |
| | | #endregion |
| | |
| | | // 5d1d52 永恒 |
| | | return new Color32(93, 29, 82, 128); |
| | | case QualityTextColType.red: |
| | | return s_BrightRedColor; |
| | | return s_DarkRedColor; |
| | | } |
| | | return new Color32(0, 0, 0, 128); |
| | | } |
| | |
| | | public static string ShowUseMoney(int moneyType, long useCnt, TextColType engoughColor = TextColType.Green) |
| | | { |
| | | long cnt = GetMoneyCnt(moneyType); |
| | | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}"); |
| | | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}"); |
| | | } |
| | | |
| | | public static string ShowUseItem(PackType type, int itemId, long useCnt, TextColType engoughColor = TextColType.Green) |
| | | { |
| | | long cnt = PackManager.Instance.GetItemCountByID(type, itemId); |
| | | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}"); |
| | | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}"); |
| | | } |
| | | |
| | | #endregion |