| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Saturday, March 02, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class EquipSuitConfig |
| | | { |
| | | |
| | | public readonly int id; |
| | | public readonly string name; |
| | | public readonly int suiteID; |
| | | public readonly int suiteCnt; |
| | | public readonly int star; |
| | | public readonly int[] attr; |
| | | public readonly int skillID; |
| | | |
| | | public EquipSuitConfig() |
| | | { |
| | | } |
| | | |
| | | public EquipSuitConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out id); |
| | | |
| | | name = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out suiteID); |
| | | |
| | | int.TryParse(tables[3],out suiteCnt); |
| | | |
| | | int.TryParse(tables[4],out star); |
| | | |
| | | string[] attrStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | attr = new int[attrStringArray.Length]; |
| | | for (int i=0;i<attrStringArray.Length;i++) |
| | | { |
| | | int.TryParse(attrStringArray[i],out attr[i]); |
| | | } |
| | | |
| | | int.TryParse(tables[6],out skillID); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, EquipSuitConfig> configs = new Dictionary<string, EquipSuitConfig>(); |
| | | public static EquipSuitConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("EquipSuitConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | EquipSuitConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new EquipSuitConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static EquipSuitConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<EquipSuitConfig> GetValues() |
| | | { |
| | | var values = new List<EquipSuitConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/EquipSuit.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/EquipSuit.txt"); |
| | | } |
| | | |
| | | var tempConfig = new EquipSuitConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new EquipSuitConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new EquipSuitConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0293f3c320d15774eb4424928e85e47a |
| | | timeCreated: 1551517326 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | public static EquipStarConfig Get(int level, int equipPlace, int star) |
| | | { |
| | | var key = Level * 10000 + EquipPlace * 100 + Star; |
| | | var key = level * 10000 + equipPlace * 100 + star; |
| | | if (equipStarConfigs.ContainsKey(key)) |
| | | { |
| | | return equipStarConfigs[key]; |
| | |
| | | int _itemId = LuaAPI.xlua_tointeger(L, 2); |
| | | GetItemWaysConfig _itemWaysModel = (GetItemWaysConfig)translator.GetObject(L, 3, typeof(GetItemWaysConfig)); |
| | | |
| | | gen_to_be_invoked.ClickGetWay( _itemId, _itemWaysModel ); |
| | | gen_to_be_invoked.ClickGetWay( 1 ); |
| | | |
| | | |
| | | |
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | CloseWin();
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().ClickGetWay(itemAttrData.itemId,itemWaysModel);
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().ClickGetWay(itemWaysModel.ID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | CloseImmediately();
|
| | | itemPathModel.ClickGetWay(itemPathModel.chinItemModel.ID,itemWaysModel);
|
| | | itemPathModel.ClickGetWay(itemWaysModel.ID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | using UnityEngine;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class GetItemPathModel : Model
|
| | | public class GetItemPathModel : Model
|
| | | {
|
| | | public ItemConfig chinItemModel { get; private set; }
|
| | | public int isBind { get; private set;}
|
| | | public int isBind { get; private set; }
|
| | | public int level { get; private set; }
|
| | | public string[] extraInfos { get; private set; }
|
| | | private StringBuilder _extraInfoBuider = new StringBuilder();
|
| | |
| | |
|
| | | public override void Init()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public void SetChinItemModel(int itemId, int isBind = 0,bool isNoOpen = false ,params string[] extraInfos)
|
| | | public void SetChinItemModel(int itemId, int isBind = 0, bool isNoOpen = false, params string[] extraInfos)
|
| | | {
|
| | | DebugEx.Log("物品ID:" + itemId);
|
| | | chinItemModel = ItemConfig.Get(itemId);
|
| | |
| | |
|
| | | this.isBind = isBind;
|
| | | this.extraInfos = extraInfos;
|
| | | if(!isNoOpen)
|
| | | if (!isNoOpen)
|
| | | {
|
| | | if (chinItemModel != null)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public void SetRuneModel(int itemId,int _level, params string[] extraInfos)
|
| | | public void SetRuneModel(int itemId, int _level, params string[] extraInfos)
|
| | | {
|
| | | DebugEx.Log("物品ID:" + itemId);
|
| | | chinItemModel = ItemConfig.Get(itemId);
|
| | |
| | | WindowCenter.Instance.Open<RunePathWin>();
|
| | | }
|
| | |
|
| | | public void SetPetMatUnlockModel(int itemId, int isBind = 0,params string[] extraInfos)
|
| | | public void SetPetMatUnlockModel(int itemId, int isBind = 0, params string[] extraInfos)
|
| | | {
|
| | | DebugEx.Log("物品ID:" + itemId);
|
| | | chinItemModel = ItemConfig.Get(itemId);
|
| | |
| | | return "";
|
| | |
|
| | | int i = 0;
|
| | | for(i = 0; i < extraInfos.Length; i++)
|
| | | for (i = 0; i < extraInfos.Length; i++)
|
| | | {
|
| | | _extraInfoBuider.Append(extraInfos[i] + "\n");
|
| | | }
|
| | |
| | | if (itemConfig == null) return getWayslist;
|
| | |
|
| | | waysArray = itemConfig.GetWay;
|
| | | if(waysArray != null)
|
| | | if (waysArray != null)
|
| | | {
|
| | | foreach(var id in waysArray)
|
| | | foreach (var id in waysArray)
|
| | | {
|
| | | GetItemWaysConfig itemWaysModel = GetItemWaysConfig.Get(id);
|
| | | if (itemWaysModel != null)
|
| | |
| | |
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | return getWayslist;
|
| | | }
|
| | |
|
| | | private bool CheckIsSpecGetWay(GetItemWaysConfig itemWaysModel,out bool isAddSpec)
|
| | | private bool CheckIsSpecGetWay(GetItemWaysConfig itemWaysModel, out bool isAddSpec)
|
| | | {
|
| | | isAddSpec = false;
|
| | | switch (itemWaysModel.ID)
|
| | |
| | | case 85:
|
| | | TreasureFindHostModel hostModel = ModelCenter.Instance.GetModel<TreasureFindHostModel>();
|
| | | Treasure treasure;
|
| | | ModelCenter.Instance.GetModel<TreasureModel>().TryGetTreasure(hostModel.treasureIdlist[0],out treasure);
|
| | | if(treasure != null && treasure.state != TreasureState.Collected)
|
| | | ModelCenter.Instance.GetModel<TreasureModel>().TryGetTreasure(hostModel.treasureIdlist[0], out treasure);
|
| | | if (treasure != null && treasure.state != TreasureState.Collected)
|
| | | {
|
| | | isAddSpec = true;
|
| | | }
|
| | | return true;
|
| | | default:
|
| | | break;
|
| | | |
| | |
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | {
|
| | | if (activeType == -1) return true;
|
| | |
|
| | | return OpenServerActivityCenter.Instance.IsActivityOpen(activeType);
|
| | | return OpenServerActivityCenter.Instance.IsActivityOpen(activeType);
|
| | | }
|
| | |
|
| | | public void ClickGetWay(int itemId, GetItemWaysConfig itemWaysModel)
|
| | | public void ClickGetWay(int getWayId)
|
| | | {
|
| | | if (itemWaysModel == null) return;
|
| | | var config = GetItemWaysConfig.Get(getWayId);
|
| | | if (config == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | switch(itemWaysModel.ID)
|
| | | switch (config.ID)
|
| | | {
|
| | | case 38:
|
| | | SetUnionWarehouseGetWay();
|
| | | break;
|
| | | }
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)itemWaysModel.OpenpanelId);
|
| | |
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.OpenpanelId);
|
| | | }
|
| | |
|
| | | public void SetUnionWarehouseGetWay()
|
| | |
| | | private RectTransform infoTip = null;
|
| | | private RectTransform waysTip = null;
|
| | |
|
| | | public void SetInfoTipsPos(RectTransform infoTip,RectTransform waysTip)
|
| | | public void SetInfoTipsPos(RectTransform infoTip, RectTransform waysTip)
|
| | | {
|
| | | this.infoTip = infoTip;
|
| | | this.waysTip = waysTip;
|
| | | float y = -750 / 2 + infoTip.sizeDelta.y / 2;
|
| | | infoTip.anchoredPosition3D = new Vector3(infoTip.anchoredPosition3D.x,y,0);
|
| | | infoTip.anchoredPosition3D = new Vector3(infoTip.anchoredPosition3D.x, y, 0);
|
| | | waysTip.anchoredPosition3D = new Vector3(waysTip.anchoredPosition3D.x, y, 0);
|
| | | }
|
| | |
|
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | CloseImmediately();
|
| | | itemPathModel.ClickGetWay(itemPathModel.chinItemModel.ID, itemWaysModel);
|
| | | itemPathModel.ClickGetWay(itemWaysModel.ID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | CloseImmediately();
|
| | | itemPathModel.ClickGetWay(itemPathModel.chinItemModel.ID,itemWaysModel);
|
| | | itemPathModel.ClickGetWay(itemWaysModel.ID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel) |
| | | { |
| | | CloseImmediately(); |
| | | itemPathModel.ClickGetWay(itemPathModel.chinItemModel.ID, itemWaysModel); |
| | | itemPathModel.ClickGetWay(itemWaysModel.ID); |
| | | } |
| | | |
| | | private void CloseWin() |
| | |
| | | [SerializeField] ItemCell m_ItemCell; |
| | | [SerializeField] Text m_EquipName; |
| | | [SerializeField] Text m_EquipSorce; |
| | | [SerializeField] Image m_SorceCompare; |
| | | [SerializeField] Button m_Select; |
| | | [SerializeField] RectTransform m_SelectedContainer; |
| | | |
| | | EquipModel model { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | |
| | | m_EquipSorce.text = equip.equipScore.ToString(); |
| | | |
| | | var isBetter = model.IsBetterThanCurrent(this.equipGuid); |
| | | m_SorceCompare.SetSprite(isBetter ? "" : ""); |
| | | } |
| | | |
| | | private void DisplayDynamicInfo(bool force) |
| | | { |
| | | if (force || candidateEquip.selected.dirty) |
| | | { |
| | | m_SelectedContainer.gameObject.SetActive(candidateEquip.selected.Fetch()); |
| | | } |
| | | } |
| | | |
| | |
| | | [SerializeField] Text m_Title; |
| | | [SerializeField] RectTransform m_CandidateContainer; |
| | | [SerializeField] CyclicScroll m_CandidateEquipScroll; |
| | | [SerializeField] Button m_PutonEquip; |
| | | |
| | | [SerializeField] RectTransform m_GetWayContainer; |
| | | [SerializeField] WayCell[] m_GetWayCells; |
| | | |
| | | EquipModel model { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } |
| | | |
| | |
| | | m_CandidateContainer.gameObject.SetActive(false); |
| | | m_GetWayContainer.gameObject.SetActive(true); |
| | | } |
| | | |
| | | m_PutonEquip.SetListener(() => { model.PutOn(model.selectedEquip.value); }); |
| | | } |
| | | |
| | | public void Dispose() |
| | |
| | | |
| | | } |
| | | |
| | | private void DisplayGetWays() |
| | | { |
| | | var getWays = new List<int>(); |
| | | for (var i = 0; i < m_GetWayCells.Length; i++) |
| | | { |
| | | var behaviour = m_GetWayCells[i]; |
| | | if (i < getWays.Count) |
| | | { |
| | | behaviour.gameObject.SetActive(true); |
| | | var config = GetItemWaysConfig.Get(getWays[i]); |
| | | behaviour.icon.SetSprite(config.Icon); |
| | | behaviour.wayName.text = config.Text; |
| | | behaviour.funcName.text = config.name; |
| | | behaviour.wayButton.SetListener(() => |
| | | { |
| | | WindowCenter.Instance.Close<EquipFrameWin>(); |
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().ClickGetWay(config.ID); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | behaviour.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | public class EquipFrameWin : Window |
| | | { |
| | | [SerializeField] Button m_Close; |
| | | [SerializeField] CyclicScroll m_EquipLevelScroll; |
| | | |
| | | [SerializeField] FunctionButtonGroup m_Group; |
| | | [SerializeField] FunctionButton m_Equip; |
| | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | |
| | | var levels = model.GetAllEquipSets(); |
| | | var selectedLevel = model.selectedLevel.value; |
| | | if (selectedLevel == 0) |
| | | { |
| | | selectedLevel = model.GetLastestUnLockEquipSet(); |
| | | } |
| | | m_EquipLevelScroll.Init(levels); |
| | | m_EquipLevelScroll.MoveToCenter(levels.IndexOf(selectedLevel)); |
| | | |
| | | m_Group.TriggerByOrder(functionOrder); |
| | | } |
| | | |
| | |
| | | { |
| | | item.selected.value = item.level == selectedLevel.value; |
| | | } |
| | | |
| | | if (equipSets.ContainsKey(level)) |
| | | { |
| | | equipSets[level].SelectPlace(place); |
| | | } |
| | | } |
| | | |
| | | public void ResetSelectParams() |
| | |
| | | return set.IsBetterThanCurrent(equipGuid); |
| | | } |
| | | |
| | | public EquipSuitPropertyEntry GetEquipSuitEntry(int level, EquipSuitType type) |
| | | { |
| | | var entry = new EquipSuitPropertyEntry(); |
| | | switch (type) |
| | | { |
| | | case EquipSuitType.TwoSuit: |
| | | break; |
| | | case EquipSuitType.FiveSuit: |
| | | break; |
| | | case EquipSuitType.EightSuit: |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | return entry; |
| | | } |
| | | |
| | | private void OnPlayerDataRefresh(PlayerDataRefresh type, int value) |
| | | { |
| | | switch (type) |
| | |
| | | |
| | | public struct EquipSuitPropertyEntry |
| | | { |
| | | public EquipSuitType type; |
| | | public bool actived; |
| | | public int needCount; |
| | | public int ownCount; |
| | | public int starLevel; |
| | | public List<Int2> properties; |
| | | public int currentStarLevel; |
| | | public int nextStarLevel; |
| | | public List<Int2> currentProperties; |
| | | public List<Int2> nextProperties; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | public void SelectPlace(int place) |
| | | { |
| | | foreach (var item in equipSlots.Values) |
| | | { |
| | | item.selected.value = item.place == place; |
| | | } |
| | | } |
| | | |
| | | public bool IsSlotUnLocked(int place) |
| | | { |
| | | if (!equipSlots.ContainsKey(place)) |
| | |
| | | { |
| | | public readonly int level; |
| | | public readonly int place; |
| | | public readonly LogicBool selected = new LogicBool(); |
| | | public readonly LogicBool unLocked = new LogicBool(); |
| | | public readonly LogicString equip = new LogicString(); |
| | | |
| | |
| | | public class EquipSlotBehaviour : MonoBehaviour |
| | | { |
| | | [SerializeField] Button m_Select; |
| | | [SerializeField] RectTransform m_SelectedContainer; |
| | | |
| | | [SerializeField] Text m_SlotName; |
| | | [SerializeField] Image m_Icon; |
| | |
| | | if (unLocked) |
| | | { |
| | | m_LockContainer.gameObject.SetActive(false); |
| | | m_SlotName.gameObject.SetActive(string.IsNullOrEmpty(slot.equip.value)); |
| | | } |
| | | else |
| | | { |
| | | m_LockContainer.gameObject.SetActive(true); |
| | | m_SlotName.gameObject.SetActive(false); |
| | | var needRealm = slot.GetUnLockRealmLevel(); |
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel; |
| | | if (realmLevel >= needRealm) |
| | |
| | | var equip = packModel.GetItemByGuid(equipGuid); |
| | | if (equip == null) |
| | | { |
| | | m_SlotName.gameObject.SetActive(false); |
| | | m_Icon.SetSprite(GetDefaultEquipIcon(slot.place)); |
| | | m_IconFrame.gameObject.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | m_SlotName.gameObject.SetActive(slot.unLocked.value); |
| | | m_Icon.SetSprite(equip.config.IconKey); |
| | | m_IconFrame.SetItemBackGround(equip.config.ItemColor); |
| | | } |
| | | } |
| | | |
| | | if (force || slot.selected.dirty) |
| | | { |
| | | m_SelectedContainer.gameObject.SetActive(slot.selected.Fetch()); |
| | | } |
| | | } |
| | | |
| | | private string GetDefaultEquipIcon(int place) |
| | |
| | | public class EquipSuitPropertyBar : MonoBehaviour |
| | | { |
| | | [SerializeField] Text m_Titile; |
| | | [SerializeField] Text[] m_Properties; |
| | | [SerializeField] PropertyLine[] m_Properties; |
| | | |
| | | public void Display(EquipSuitPropertyEntry entry) |
| | | { |
| | | if (entry.actived) |
| | | switch (entry.type) |
| | | { |
| | | m_Titile.text = string.Format("【{0}件{1}星】效果:", entry.needCount, entry.starLevel); |
| | | case EquipSuitType.TwoSuit: |
| | | m_Titile.text = "【2件】"; |
| | | break; |
| | | case EquipSuitType.FiveSuit: |
| | | m_Titile.text = "【5件】"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | m_Titile.text = string.Format("【{0}件{1}星】激活({2}/{3}):", entry.needCount, entry.starLevel, entry.ownCount, entry.needCount); |
| | | } |
| | | |
| | | m_Titile.color = UIHelper.GetUIColor(entry.actived ? TextColType.Green : TextColType.Gray, true); |
| | | |
| | | for (var i = 0; i < m_Properties.Length; i++) |
| | | { |
| | | var text = m_Properties[i]; |
| | | if (i < entry.properties.Count) |
| | | var behaviour = m_Properties[i]; |
| | | if (entry.actived && entry.currentStarLevel != entry.nextStarLevel) |
| | | { |
| | | var property = entry.properties[i]; |
| | | text.gameObject.SetActive(true); |
| | | if (property.y > 0) |
| | | if (i < entry.currentProperties.Count) |
| | | { |
| | | 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); |
| | | var propertyId = entry.currentProperties[i].x; |
| | | var currentValue = entry.currentProperties[i].y; |
| | | var nextValue = entry.nextProperties[i].y; |
| | | behaviour.Display(new Int3(propertyId, currentValue, nextValue), entry.nextStarLevel); |
| | | } |
| | | else |
| | | { |
| | | |
| | | behaviour.Hide(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | text.gameObject.SetActive(false); |
| | | if (i < entry.currentProperties.Count) |
| | | { |
| | | behaviour.Display(entry.currentProperties[i], entry.actived); |
| | | } |
| | | else |
| | | { |
| | | behaviour.Hide(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var color = UIHelper.GetUIColor(entry.actived ? TextColType.Green : TextColType.Gray); |
| | | m_Titile.color = color; |
| | | foreach (var item in m_Properties) |
| | | [System.Serializable] |
| | | public class PropertyLine |
| | | { |
| | | public RectTransform container; |
| | | public Text current; |
| | | public Image arrow; |
| | | public Text next; |
| | | |
| | | public void Display(Int3 property, int nextLevel) |
| | | { |
| | | item.color = color; |
| | | container.gameObject.SetActive(true); |
| | | |
| | | var config = PlayerPropertyConfig.Get(property.x); |
| | | var isPercentage = config.ISPercentage == 1; |
| | | |
| | | var valueDescription = isPercentage ? StringUtility.Contact(Mathf.RoundToInt(property.y * 0.01f), "%") : property.y.ToString(); |
| | | current.text = string.Format("{0} +{1}", config.Name, valueDescription); |
| | | current.color = UIHelper.GetUIColor(TextColType.Green, true); |
| | | |
| | | arrow.gameObject.SetActive(true); |
| | | |
| | | valueDescription = isPercentage ? StringUtility.Contact(Mathf.RoundToInt(property.z * 0.01f), "%") : property.z.ToString(); |
| | | next.text = string.Format("{0}星 +{1}", nextLevel, valueDescription); |
| | | next.color = UIHelper.GetUIColor(TextColType.Gray, true); |
| | | } |
| | | |
| | | public void Display(Int2 property, bool active) |
| | | { |
| | | container.gameObject.SetActive(true); |
| | | |
| | | var config = PlayerPropertyConfig.Get(property.x); |
| | | var isPercentage = config.ISPercentage == 1; |
| | | var valueDescription = isPercentage ? StringUtility.Contact(Mathf.RoundToInt(property.y * 0.01f), "%") : property.y.ToString(); |
| | | current.text = string.Format("{0} +{1}", config.Name, valueDescription); |
| | | arrow.gameObject.SetActive(true); |
| | | next.text = string.Empty; |
| | | |
| | | current.color = UIHelper.GetUIColor(active ? TextColType.Green : TextColType.Gray, true); |
| | | } |
| | | |
| | | public void Hide() |
| | | { |
| | | container.gameObject.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | |
| | | [SerializeField] Text m_SuitName; |
| | | [SerializeField] Text[] m_SuitEquipNames; |
| | | |
| | | [SerializeField] Text m_CurrentTitle; |
| | | [SerializeField] Text m_CurrentNone; |
| | | [SerializeField] EquipSuitPropertyBar[] m_CurrentProperties; |
| | | [SerializeField] Text m_NextTitle; |
| | | [SerializeField] Text m_NextMax; |
| | | [SerializeField] EquipSuitPropertyBar[] m_NextProperties; |
| | | [SerializeField] EquipSuitPropertyBar m_TwoSuit; |
| | | [SerializeField] EquipSuitPropertyBar m_FiveSuit; |
| | | [SerializeField] Text m_EightSuitDescription; |
| | | |
| | | 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); |
| | | } |
| | | m_TwoSuit.Display(model.GetEquipSuitEntry(level, EquipSuitType.TwoSuit)); |
| | | m_FiveSuit.Display(model.GetEquipSuitEntry(level, EquipSuitType.FiveSuit)); |
| | | |
| | | m_EightSuitDescription.text = ""; |
| | | } |
| | | |
| | | public void Dispose() |
| | |
| | | |
| | | } |
| | | |
| | | private string GetEightSuitDescription(int level) |
| | | { |
| | | var lines = new List<string>(); |
| | | |
| | | |
| | | |
| | | return string.Empty; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | [SerializeField] RawImage m_Role; |
| | | [SerializeField] Button m_SelectAppearance; |
| | | |
| | | [SerializeField] Toggle m_SuitProperty; |
| | | [SerializeField] Toggle m_CandidateEquip; |
| | | |
| | | [SerializeField] EquipSuitPropertyWidget m_SuitPropertyWidget; |
| | | [SerializeField] CandidateEquipWidget m_CandidateEquipWidget; |
| | | |
| | | ShowType currentShowType = ShowType.SuitProperty; |
| | | EquipModel model { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } |
| | | |
| | | #region Built-in |
| | |
| | | protected override void AddListeners() |
| | | { |
| | | m_SelectAppearance.SetListener(() => { model.SetAppearance(model.selectedLevel.value); }); |
| | | |
| | | m_SuitProperty.SetListener((bool value) => |
| | | { |
| | | if (value) |
| | | { |
| | | ShowSuitProperty(model.selectedLevel.value); |
| | | } |
| | | }); |
| | | |
| | | m_CandidateEquip.SetListener((bool value) => |
| | | { |
| | | if (value) |
| | | { |
| | | ShowCandidateEquips(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | m_SuitProperty.isOn = true; |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | |
| | | DisplayDynamicInfo(true); |
| | | |
| | | ShowCandidateEquips(); |
| | | } |
| | | |
| | | protected override void LateUpdate() |
| | |
| | | |
| | | private void ShowSuitProperty(int level) |
| | | { |
| | | currentShowType = ShowType.SuitProperty; |
| | | m_SuitPropertyWidget.gameObject.SetActive(true); |
| | | m_CandidateEquipWidget.gameObject.SetActive(false); |
| | | |
| | |
| | | |
| | | private void ShowCandidateEquips() |
| | | { |
| | | currentShowType = ShowType.CandidateEquip; |
| | | m_SuitPropertyWidget.gameObject.SetActive(false); |
| | | m_CandidateEquipWidget.gameObject.SetActive(true); |
| | | |
| | | DisplayCandidateEquips(); |
| | | m_CandidateEquipWidget.Display(); |
| | | } |
| | | |
| | | private void DisplayDynamicInfo(bool force) |
| | |
| | | DisplayEquips(level); |
| | | DisplayAppearance(level); |
| | | DisplayFightPoint(level); |
| | | if (currentShowType == ShowType.SuitProperty) |
| | | { |
| | | ShowSuitProperty(level); |
| | | } |
| | | ShowSuitProperty(level); |
| | | } |
| | | |
| | | if (force || model.selectedPlace.dirty) |
| | | { |
| | | var place = model.selectedPlace.Fetch(); |
| | | if (currentShowType == ShowType.CandidateEquip) |
| | | { |
| | | ShowCandidateEquips(); |
| | | } |
| | | ShowCandidateEquips(); |
| | | } |
| | | } |
| | | |
| | |
| | | m_FightPoint.text = model.GetFightPoint(level).ToString(); |
| | | } |
| | | |
| | | private void DisplayCandidateEquips() |
| | | { |
| | | m_CandidateEquipWidget.Display(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | public enum ShowType |
| | | { |
| | | SuitProperty, |
| | | CandidateEquip, |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class EquipSlots |
| | |
| | | |
| | | public enum EquipSuitType |
| | | { |
| | | ThreeSuit = 3, |
| | | TwoSuit = 2, |
| | | FiveSuit = 5, |
| | | EightSuit = 8, |
| | | } |
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | CloseImmediately();
|
| | | itemPathModel.ClickGetWay(itemConfig.ID, itemWaysModel);
|
| | | itemPathModel.ClickGetWay(itemWaysModel.ID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | OnClickCloseBtn();
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().ClickGetWay(itemAttrData.itemId, itemWaysModel);
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().ClickGetWay( itemWaysModel.ID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | normalTasks.Add(new ConfigInitTask("CrossRealmPKDanAwardConfig", () => { CrossRealmPKDanAwardConfig.Init(); }, () => { return CrossRealmPKDanAwardConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("CrossServerOneVsOneRobotConfig", () => { CrossServerOneVsOneRobotConfig.Init(); }, () => { return CrossServerOneVsOneRobotConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("EquipPlaceMapConfig", () => { EquipPlaceMapConfig.Init(); }, () => { return EquipPlaceMapConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("EquipControlConfig", () => { EquipControlConfig.Init(); }, () => { return EquipControlConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("EquipControlConfig", () => { EquipControlConfig.Init(); }, () => { return EquipControlConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("EquipSuitConfig", () => { EquipSuitConfig.Init(); }, () => { return EquipSuitConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |