| | |
| | | } |
| | | |
| | | } |
| | | |
| | | public struct EquipSuitPropertyEntry |
| | | { |
| | | public bool actived; |
| | | public int needCount; |
| | | public int ownCount; |
| | | public int starLevel; |
| | | public List<Int2> properties; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | return slotPlace == equipPlace; |
| | | } |
| | | |
| | | public static EquipSuitType GetSuitType(int place) |
| | | { |
| | | switch (place) |
| | | { |
| | | case 1: |
| | | case 3: |
| | | case 4: |
| | | return EquipSuitType.Attack; |
| | | case 2: |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | return EquipSuitType.Defend; |
| | | default: |
| | | return EquipSuitType.None; |
| | | } |
| | | } |
| | | |
| | | public static Int2 ServerPlaceToClientPlace(int serverPlace) |
| | | { |
| | | return new Int2((serverPlace / 12) + 1, serverPlace % 12); |
| | | } |
| | | |
| | | } |
| | | |
| | | public enum EquipSuitType |
| | | { |
| | | None = 0, |
| | | Attack = 1, |
| | | Defend = 2, |
| | | } |
| | | |
| | | public struct EquipAppearance |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, February 28, 2019 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class EquipSuitPropertyBar : MonoBehaviour |
| | | { |
| | | [SerializeField] Text m_Titile; |
| | | [SerializeField] Text[] m_Properties; |
| | | |
| | | public void Display(EquipSuitPropertyEntry entry) |
| | | { |
| | | if (entry.actived) |
| | | { |
| | | m_Titile.text = string.Format("【{0}件{1}星】效果:", entry.needCount, entry.starLevel); |
| | | } |
| | | else |
| | | { |
| | | m_Titile.text = string.Format("【{0}件{1}星】激活({2}/{3}):", entry.needCount, entry.starLevel, entry.ownCount, entry.needCount); |
| | | } |
| | | |
| | | for (var i = 0; i < m_Properties.Length; i++) |
| | | { |
| | | var text = m_Properties[i]; |
| | | if (i < entry.properties.Count) |
| | | { |
| | | var property = entry.properties[i]; |
| | | text.gameObject.SetActive(true); |
| | | if (property.y > 0) |
| | | { |
| | | var config = PlayerPropertyConfig.Get(property.x); |
| | | var valueDescription = config.ISPercentage == 1 ? |
| | | StringUtility.Contact(Mathf.RoundToInt(property.y * 0.01f), "%") : property.y.ToString(); |
| | | |
| | | text.text = string.Format("{0} +{1}", config.Name, valueDescription); |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | text.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | var color = UIHelper.GetUIColor(entry.actived ? TextColType.Green : TextColType.Gray); |
| | | m_Titile.color = color; |
| | | foreach (var item in m_Properties) |
| | | { |
| | | item.color = color; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ed7eefa6735e68448a2246f63339b66e |
| | | timeCreated: 1551358637 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | [SerializeField] Text m_SuitName; |
| | | [SerializeField] Text[] m_SuitEquipNames; |
| | | [SerializeField] Text m_CurrentLevel; |
| | | [SerializeField] Text m_CurrentDescription; |
| | | [SerializeField] Text[] m_Properties; |
| | | [SerializeField] Text m_NextLevel; |
| | | [SerializeField] Text m_NextDescription; |
| | | |
| | | [SerializeField] Text[] m_NextProperties; |
| | | [SerializeField] Text m_CurrentTitle; |
| | | [SerializeField] Text m_CurrentNone; |
| | | [SerializeField] EquipSuitPropertyBar[] m_CurrentProperties; |
| | | [SerializeField] Text m_NextTitle; |
| | | [SerializeField] Text m_NextMax; |
| | | [SerializeField] EquipSuitPropertyBar[] m_NextProperties; |
| | | |
| | | EquipModel model { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } |
| | | EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } |
| | | |
| | | public void Display(int level) |
| | | { |
| | | var threeSuitLevel = starModel.GetSuitLevel(level, EquipSuitType.ThreeSuit); |
| | | var fiveSuitLevel = 0; |
| | | var eightSuitLevel = 0; |
| | | var hasSuitEffect = false; |
| | | if (threeSuitLevel != 0) |
| | | { |
| | | hasSuitEffect = true; |
| | | fiveSuitLevel = starModel.GetSuitLevel(level, EquipSuitType.FiveSuit); |
| | | eightSuitLevel = starModel.GetSuitLevel(level, EquipSuitType.EightSuit); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | public class EquipSetStar |
| | | { |
| | | |
| | | public readonly int level = 0; |
| | | Dictionary<int, int> equipStars = new Dictionary<int, int>(); |
| | | Dictionary<EquipSuitType, int> suitLevels = new Dictionary<EquipSuitType, int>(); |
| | | |
| | | public EquipSetStar(int level) |
| | | { |
| | |
| | | return count; |
| | | } |
| | | |
| | | public void UpdateSuitLevel(EquipSuitType type, int level) |
| | | { |
| | | suitLevels[type] = level; |
| | | } |
| | | |
| | | public int GetSuitLevel(EquipSuitType type) |
| | | { |
| | | return suitLevels[type]; |
| | | } |
| | | |
| | | } |
| | | |
| | | public enum EquipSuitType |
| | | { |
| | | ThreeSuit = 3, |
| | | FiveSuit = 5, |
| | | EightSuit = 8, |
| | | } |
| | | |
| | | public struct EquipStar |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public void UpdateSuitLevel(int level, EquipSuitType type, int starLevel) |
| | | { |
| | | if (!equipStars.ContainsKey(level)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | equipStars[level].UpdateSuitLevel(type, starLevel); |
| | | } |
| | | |
| | | public int GetSuitLevel(int level, EquipSuitType type) |
| | | { |
| | | if (!equipStars.ContainsKey(level)) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | return equipStars[level].GetSuitLevel(type); |
| | | } |
| | | |
| | | private List<string> GetStarUpgradableEquips(int level) |
| | | { |
| | | var equipSet = equipModel.GetEquipSet(level); |