Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
# Conflicts:
# Main/Config/Configs/ChestsAwardConfig.cs
28个文件已修改
1个文件已删除
9 文件已复制
10个文件已添加
1 文件已重命名
| | |
| | | using System.Collections; |
| | | |
| | | |
| | | public class ButtonClickInterval : MonoBehaviour |
| | | public class ButtonClickInterval : MonoBehaviour |
| | | { |
| | | [SerializeField] float interval = 1f; |
| | | [SerializeField] Button targetBtn; |
| | | |
| | | private void Awake() |
| | | { |
| | | [SerializeField] float interval = 1f; |
| | | [SerializeField] Button targetBtn; |
| | | |
| | | private void Awake() |
| | | { |
| | | targetBtn.AddListener(OnClick); |
| | | } |
| | | |
| | | private void OnClick() |
| | | { |
| | | targetBtn.enabled = false; |
| | | StartCoroutine(DelayClick()); |
| | | } |
| | | |
| | | IEnumerator DelayClick() |
| | | { |
| | | yield return new WaitForSeconds(interval); |
| | | targetBtn.enabled = true; |
| | | } |
| | | targetBtn.AddListener(OnClick); |
| | | } |
| | | |
| | | private void OnClick() |
| | | { |
| | | targetBtn.enabled = false; |
| | | StartCoroutine(DelayClick()); |
| | | } |
| | | |
| | | IEnumerator DelayClick() |
| | | { |
| | | yield return new WaitForSeconds(interval); |
| | | targetBtn.enabled = true; |
| | | } |
| | | } |
| | |
| | | using UnityEngine.Serialization; |
| | | using UnityEngine.UI; |
| | | |
| | | public class LongPressButton : ButtonEx |
| | | public class LongPressButton : ButtonEx |
| | | { |
| | | public class ButtonPressEvent : UnityEvent { } |
| | | |
| | | //长按监听 |
| | | [FormerlySerializedAs("onPress")] |
| | | [SerializeField] |
| | | private ButtonPressEvent m_OnPress = new ButtonPressEvent(); |
| | | public ButtonPressEvent onPress |
| | | { |
| | | public class ButtonPressEvent : UnityEvent { } |
| | | get { return m_OnPress; } |
| | | set { m_OnPress = value; } |
| | | } |
| | | |
| | | [FormerlySerializedAs("onPress")] |
| | | [SerializeField] |
| | | private ButtonPressEvent m_OnPress = new ButtonPressEvent(); |
| | | public ButtonPressEvent onPress |
| | | [SerializeField] |
| | | float m_LongPressCheckTime = 0.3f; |
| | | public float longPressCheckTime |
| | | { |
| | | get { return m_LongPressCheckTime; } |
| | | set { m_LongPressCheckTime = value; } |
| | | } |
| | | [SerializeField] |
| | | float m_LongPressIntervalTime = 0.1f; |
| | | public float longPressIntervalTime |
| | | { |
| | | get { return m_LongPressIntervalTime; } |
| | | set { m_LongPressIntervalTime = value; } |
| | | } |
| | | |
| | | float m_PressTime = 0.0f; |
| | | float m_PressIntervalTime = 0.0f; |
| | | bool m_LongPress = false; |
| | | bool m_IsButtonDown = false; |
| | | |
| | | public override void OnPointerClick(PointerEventData eventData) |
| | | { |
| | | if (m_LongPress) |
| | | { |
| | | get { return m_OnPress; } |
| | | set { m_OnPress = value; } |
| | | m_LongPress = false; |
| | | return; |
| | | } |
| | | base.OnPointerClick(eventData); |
| | | } |
| | | |
| | | [SerializeField] |
| | | float m_LongPressCheckTime = 0.5f; |
| | | public float longPressCheckTime |
| | | { |
| | | get { return m_LongPressCheckTime; } |
| | | set { m_LongPressCheckTime = value; } |
| | | } |
| | | [SerializeField] |
| | | float m_LongPressIntervalTime = 0.1f; |
| | | public float longPressIntervalTime |
| | | { |
| | | get { return m_LongPressIntervalTime; } |
| | | set { m_LongPressIntervalTime = value; } |
| | | } |
| | | public override void OnPointerDown(PointerEventData eventData) |
| | | { |
| | | base.OnPointerDown(eventData); |
| | | m_PressTime = 0.0f; |
| | | m_PressIntervalTime = 0.0f; |
| | | m_IsButtonDown = true; |
| | | } |
| | | |
| | | float m_PressTime = 0.0f; |
| | | float m_PressIntervalTime = 0.0f; |
| | | bool m_LongPress = false; |
| | | bool m_IsButtonDown = false; |
| | | public override void OnPointerUp(PointerEventData eventData) |
| | | { |
| | | base.OnPointerUp(eventData); |
| | | m_IsButtonDown = false; |
| | | } |
| | | |
| | | public override void OnPointerClick(PointerEventData eventData) |
| | | public override void OnPointerExit(PointerEventData eventData) |
| | | { |
| | | base.OnPointerExit(eventData); |
| | | m_IsButtonDown = false; |
| | | m_LongPress = false; |
| | | } |
| | | |
| | | private void Update() |
| | | { |
| | | if (m_IsButtonDown) |
| | | { |
| | | if (m_LongPress) |
| | | m_PressTime += Time.deltaTime; |
| | | if (m_PressTime < m_LongPressCheckTime) |
| | | { |
| | | m_LongPress = false; |
| | | return; |
| | | } |
| | | base.OnPointerClick(eventData); |
| | | } |
| | | |
| | | public override void OnPointerDown(PointerEventData eventData) |
| | | { |
| | | base.OnPointerDown(eventData); |
| | | m_PressTime = 0.0f; |
| | | m_PressIntervalTime = 0.0f; |
| | | m_IsButtonDown = true; |
| | | } |
| | | |
| | | public override void OnPointerUp(PointerEventData eventData) |
| | | { |
| | | base.OnPointerUp(eventData); |
| | | m_IsButtonDown = false; |
| | | } |
| | | |
| | | public override void OnPointerExit(PointerEventData eventData) |
| | | { |
| | | base.OnPointerExit(eventData); |
| | | m_IsButtonDown = false; |
| | | m_LongPress = false; |
| | | } |
| | | |
| | | private void Update() |
| | | { |
| | | if (m_IsButtonDown) |
| | | if (m_PressIntervalTime >= m_LongPressIntervalTime) |
| | | { |
| | | m_PressTime += Time.deltaTime; |
| | | if (m_PressTime < m_LongPressCheckTime) |
| | | { |
| | | return; |
| | | } |
| | | if (m_PressIntervalTime >= m_LongPressIntervalTime) |
| | | { |
| | | onPress.Invoke(); |
| | | m_PressIntervalTime = 0.0f; |
| | | } |
| | | m_PressIntervalTime += Time.deltaTime; |
| | | m_LongPress = true; |
| | | onPress.Invoke(); |
| | | m_PressIntervalTime = 0.0f; |
| | | } |
| | | m_PressIntervalTime += Time.deltaTime; |
| | | m_LongPress = true; |
| | | } |
| | | } |
| | | |
| | | protected override void OnEnable() |
| | | { |
| | | base.OnEnable(); |
| | | m_LongPress = false; |
| | | m_IsButtonDown = false; |
| | | } |
| | | } |
| | | protected override void OnEnable() |
| | | { |
| | | base.OnEnable(); |
| | | m_LongPress = false; |
| | | m_IsButtonDown = false; |
| | | } |
| | | } |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System; |
| | | |
| | | /// <summary> |
| | | /// 进度条功能,带有+-按钮控制,最大数量按钮 |
| | | /// </summary> |
| | | public class SliderPanel : MonoBehaviour |
| | | { |
| | | [SerializeField] Text countText; |
| | | [SerializeField] Slider slider; |
| | | [SerializeField] LongPressButton addBtn; |
| | | [SerializeField] LongPressButton decBtn; |
| | | [SerializeField] ButtonEx maxBtn; |
| | | |
| | | int count; |
| | | int maxCount; |
| | | |
| | | Action<int> OnChangeEvent; |
| | | void Start() |
| | | { |
| | | slider.AddListener((value) => { Refresh(); }); |
| | | addBtn.AddListener(() => |
| | | { |
| | | slider.value += 1; |
| | | Refresh(); |
| | | }); |
| | | addBtn.onPress.AddListener(() => |
| | | { |
| | | slider.value += 1; |
| | | Refresh(); |
| | | }); |
| | | decBtn.AddListener(() => |
| | | { |
| | | slider.value -= 1; |
| | | Refresh(); |
| | | }); |
| | | decBtn.onPress.AddListener(() => |
| | | { |
| | | slider.value -= 1; |
| | | Refresh(); |
| | | }); |
| | | |
| | | maxBtn.AddListener(() => |
| | | { |
| | | slider.value = slider.maxValue; |
| | | Refresh(); |
| | | }); |
| | | } |
| | | |
| | | public void Init(Action<int> _OnChangeEvent, int _maxCount, int _count = 1) |
| | | { |
| | | count = _count; |
| | | maxCount = _maxCount; |
| | | slider.minValue = 1; |
| | | slider.maxValue = _maxCount; |
| | | slider.value = count; |
| | | |
| | | Refresh(); |
| | | OnChangeEvent = _OnChangeEvent; |
| | | |
| | | } |
| | | |
| | | void Refresh() |
| | | { |
| | | count = (int)slider.value; |
| | | countText.text = count.ToString(); |
| | | if (count >= maxCount) |
| | | { |
| | | addBtn.interactable = false; |
| | | addBtn.SetColorful(null, false); |
| | | maxBtn.interactable = false; |
| | | maxBtn.SetColorful(null, false); |
| | | } |
| | | else |
| | | { |
| | | addBtn.interactable = true; |
| | | addBtn.SetColorful(null, true); |
| | | maxBtn.interactable = true; |
| | | maxBtn.SetColorful(null, true); |
| | | } |
| | | |
| | | if (count <= 0) |
| | | { |
| | | decBtn.interactable = false; |
| | | decBtn.SetColorful(null, false); |
| | | } |
| | | else |
| | | { |
| | | decBtn.interactable = true; |
| | | decBtn.SetColorful(null, true); |
| | | } |
| | | |
| | | OnChangeEvent?.Invoke(count); |
| | | } |
| | | |
| | | } |
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/Component/UI/Common/SliderPanel.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: 3525ae0230fc77c439297c3fe45ed8d5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | return msg.Split('_');
|
| | | }
|
| | |
|
| | | //一维数组:来源格式如 1_2|2_3|3_1|4_3;
|
| | | //返回一维数组结构如 1|2|3|4
|
| | | public static T[] GetKeyValueKeys<T>(string msg) where T : struct
|
| | | {
|
| | | string[] segs = GetMultipleStr(msg);
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | //一维数组:来源格式如 1_2|2_3|3_1|4_3;
|
| | | //返回一维数组结构如 2|3|1|3
|
| | | public static T[] GetKeyValueValues<T>(string msg) where T : struct
|
| | | {
|
| | | string[] segs = GetMultipleStr(msg);
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | //二维数组:来源格式如 1_2_1|2_3_4|3_1_2|4_3_4
|
| | | public static T[][] GetArray2<T>(string msg) where T : struct
|
| | | {
|
| | | string[] segs = GetMultipleStr(msg);
|
| | | if (segs != null && segs.Length > 0)
|
| | | {
|
| | | T[][] array = new T[segs.Length][];
|
| | | for (int i = 0; i < segs.Length; i++)
|
| | | {
|
| | | string[] pair = GetKeyValue(segs[i]);
|
| | | if (pair.Length > 1)
|
| | | {
|
| | | array[i] = new T[pair.Length];
|
| | | for (int j = 0; j < pair.Length; j++)
|
| | | {
|
| | | array[i][j] = (T)Convert.ChangeType(pair[j], typeof(T));
|
| | | }
|
| | | }
|
| | | }
|
| | | return array;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | //字典:来源格式如 1_2|2_3|3_1|4_3;
|
| | | public static Dictionary<T, P> GetDic<T, P>(string msg)
|
| | | {
|
| | | Dictionary<T, P> dic = null;
|
New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Sunday, February 04, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public partial class ChestsAwardConfig : ConfigBase<int, ChestsAwardConfig>
|
| | | {
|
| | |
|
| | | private static Dictionary<string, ChestsAwardConfig> chestAwardDict = new Dictionary<string, ChestsAwardConfig>();
|
| | | private static Dictionary<int, List<int>> chestIdDict = new Dictionary<int, List<int>>();
|
| | | |
| | | protected override void OnConfigParseCompleted()
|
| | | {
|
| | | string key = StringUtility.Contact(BoxID, BoxLV);
|
| | | if (!chestAwardDict.ContainsKey(key))
|
| | | {
|
| | | chestAwardDict.Add(key, this);
|
| | | }
|
| | |
|
| | | if (!chestIdDict.ContainsKey(BoxID))
|
| | | {
|
| | | List<int> boxLvlist = new List<int>();
|
| | | boxLvlist.Add(BoxLV);
|
| | | chestIdDict.Add(BoxID, boxLvlist);
|
| | | }
|
| | | else
|
| | | {
|
| | | chestIdDict[BoxID].Add(BoxLV);
|
| | | }
|
| | | }
|
| | |
|
| | | public static ChestsAwardConfig GetChestsAwardByID(int boxId)
|
| | | {
|
| | | int playerLv = PlayerDatas.Instance.baseData.LV;
|
| | | List<int> boxLvlist = null;
|
| | | int boxLv = 0;
|
| | | chestIdDict.TryGetValue(boxId, out boxLvlist);
|
| | | if (boxLvlist != null)
|
| | | {
|
| | | boxLvlist.Sort();
|
| | | for (int i = boxLvlist.Count - 1; i > -1; i--)
|
| | | {
|
| | | if (boxLvlist[i] <= playerLv)
|
| | | {
|
| | | boxLv = boxLvlist[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | return GetChestsAwardByIDAndLv(boxId, boxLv);
|
| | | }
|
| | |
|
| | | private static ChestsAwardConfig GetChestsAwardByIDAndLv(int id, int lv)
|
| | | {
|
| | | ChestsAwardConfig chestsAwardConfig = null;
|
| | | string key = StringUtility.Contact(id, lv);
|
| | | chestAwardDict.TryGetValue(key, out chestsAwardConfig);
|
| | | return chestsAwardConfig;
|
| | | }
|
| | |
|
| | | //0:不是箱子,1:随机箱子 2:自选箱子
|
| | | public static int GetBoxType(int itemID)
|
| | | {
|
| | | if (!chestIdDict.ContainsKey(itemID))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | var config = GetChestsAwardByID(itemID);
|
| | | return string.IsNullOrEmpty(config.SelectList) ? 1 : 2;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/Config/PartialConfigs/ChestsAwardConfig.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: 5ce9e992608fd9f458c1b1a26a13d102 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | |
|
| | | public class CA323_tagCMUseItems : GameNetPackBasic {
|
| | | public byte ItemIndex; //物品在背包中索引
|
| | | public ushort UseCnt; //使用个数,0表示全部使用
|
| | | public uint UseCnt; //使用个数,0表示全部使用
|
| | | public uint ExData; //使用扩展值, 默认0, 选择物品宝箱时发送选择的物品ID
|
| | | public byte SelectCount; //指定选择项,当批量使用单个箱子需要同时选中多种选项时使用该值
|
| | | public tagCMUseItemsSelect[] SelectList;
|
| | |
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (ItemIndex, NetDataType.BYTE);
|
| | | WriteBytes (UseCnt, NetDataType.WORD);
|
| | | WriteBytes (UseCnt, NetDataType.DWORD);
|
| | | WriteBytes (ExData, NetDataType.DWORD);
|
| | | WriteBytes (SelectCount, NetDataType.BYTE);
|
| | | for (int i = 0; i < SelectCount; i ++) {
|
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A2 07 背包购买格子信息 #tagSCPackBuyInfo
|
| | |
|
| | | public class DTCA207_tagSCPackBuyInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA207_tagSCPackBuyInfo vNetData = vNetPack as HA207_tagSCPackBuyInfo;
|
| | | PackManager.Instance.UpdateBuyPackGirdCount(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA207_tagSCPackBuyInfo.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: 759a621863abbf54296b3ea4121ddda3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA801_tagMCGiveAwardInfo vNetData = vNetPack as HA801_tagMCGiveAwardInfo;
|
| | | PackManager.Instance.ReceiveAwardNotify(vNetData);
|
| | | BoxGetItemModel.Instance.ReceiveAwardNotify(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | Register(typeof(H0423_tagObjPropertyRefreshView), typeof(DTC0423_tagObjPropertyRefreshView)); |
| | | Register(typeof(H0604_tagUseSkillAttack), typeof(DTC0604_tagUseSkillAttack)); |
| | | Register(typeof(HB124_tagSCLineupInfo), typeof(DTCB124_tagSCLineupInfo)); |
| | | Register(typeof(HA207_tagSCPackBuyInfo), typeof(DTCA207_tagSCPackBuyInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A2 07 背包购买格子信息 #tagSCPackBuyInfo
|
| | |
|
| | | public class HA207_tagSCPackBuyInfo : GameNetPackBasic {
|
| | | public byte Count;
|
| | | public tagSCPackBuy[] BuyInfoList;
|
| | |
|
| | | public HA207_tagSCPackBuyInfo () {
|
| | | _cmd = (ushort)0xA207;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | BuyInfoList = new tagSCPackBuy[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | BuyInfoList[i] = new tagSCPackBuy();
|
| | | TransBytes (out BuyInfoList[i].PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out BuyInfoList[i].BuyCnt, vBytes, NetDataType.WORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagSCPackBuy {
|
| | | public byte PackType; // 背包类型
|
| | | public ushort BuyCnt; // 已购买次数
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA2_Package/HA207_tagSCPackBuyInfo.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: f653b2261135c964fa493b8afb23b63c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | // UIManager.Instance.OpenWindow<LoginWin>();
|
| | | Debug.Log("切换到登录场景");
|
| | | ConfigManager.Instance.Init();
|
| | | GeneralDefine.Init();
|
| | | StageManager.Instance.ToLoginScene();
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
|
| | |
| | | } |
| | | // 添加到UI列表 |
| | | uiDict[uiName].Add(returnValue); |
| | | |
| | | |
| | | #if UNITY_EDITOR |
| | | if (uiDict[uiName].Count > 5) |
| | | { |
| | | Debug.LogError("已打开" + uiDict[uiName].Count + "个界面:" + uiName); |
| | | } |
| | | #endif |
| | | |
| | | // 将UI添加到栈中 |
| | | uiStack.Push(returnValue); |
| | | |
| | |
| | | {
|
| | | int selectID = selectItemInfo[j][selectedItemIndexs[j] - 1];
|
| | |
|
| | | items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, CTGSelectItemConfig.Get(selectID).ItemCount));
|
| | | items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, (ulong)CTGSelectItemConfig.Get(selectID).ItemCount));
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | if (i < awards.Count)
|
| | | {
|
| | | var award = awards[i];
|
| | | var itemData = new ItemCellModel(award.id, false, (ulong)award.count);
|
| | | var itemData = new ItemCellModel(award.id, false, (ulong)award.countEx);
|
| | | itemCells[i].Init(itemData);
|
| | | itemCells[i].button.SetListener(() =>
|
| | | {
|
| | |
| | | |
| | | public class GeneralDefine |
| | | { |
| | | public const int CrossBattleFieldMapID = 32060; |
| | | public const int CrossFamilyBattleMapID = 32090; |
| | | public static int initDepotGridCount { get; private set; } |
| | | public static int maxDepotGridCount { get; private set; } |
| | | public static int maxBagGridCount { get; private set; } |
| | | public static int maxXBGridCount { get; private set; } |
| | | public static Dictionary<int, int> MoneyDisplayModel { get; private set; } |
| | | public static int playerMaxLevel { get; private set; } |
| | | public static int[] kylinHomeCollectItems; |
| | | public static List<int> dailyQuestOpenTime; |
| | | public static int flyBootItemId { get; private set; } |
| | | public static int flyBootItemMoney { get; private set; } |
| | | public static int teamReadyTime { get; private set; } |
| | | public static int elderGodAreaAngerTotal { get; private set; } |
| | | public static float petRandomSpeak { get; private set; } |
| | | public static int[] openJobs { get; private set; } |
| | | public static int playerNameLength { get; private set; } |
| | | public static int guardDungeonCageNPCID { get; private set; } |
| | | public static float guardBubbleInterval { get; private set; } |
| | | public static List<int> autoOnHookMap { get; private set; } |
| | | public static float autoRideHorse { get; private set; } |
| | | |
| | | public static Dictionary<int, string> equipPlaceNameDict { get; private set; } |
| | | public static Dictionary<int, int> moneyDisplayIds { get; private set; } |
| | | public static int expDisplayId { get; private set; } |
| | | public static float xpGuideDelay { get; private set; } |
| | | public static float xpGuideDuration { get; private set; } |
| | | public static Dictionary<int, string> trailBossHeadIcons { get; private set; } |
| | | public static Dictionary<int, string> godWeaponMobs { get; private set; } |
| | | public static float ResetComAtkTime { get; private set; } |
| | | public static int RotateSpeed { get; private set; } |
| | | public static float CloseNpcDist { get; private set; } |
| | | public static float FarawayNpcDist { get; private set; } |
| | | public static List<int> SpecialNpcIDs { get; private set; } |
| | | public static Dictionary<int, int> wingEquipLimits { get; private set; } |
| | | public static float PetDanceInterval { get; private set; } |
| | | public static float FuncNpcDanceInterval { get; private set; } |
| | | public static float audioScaleWhenFullScreenOn { get; private set; } |
| | | public static int ruinsTranscriptMapId { get; private set; } |
| | | public static List<int> GuardianPickUpID { get; private set; } |
| | | public static List<int> EarlierGetTreasure { get; private set; } |
| | | public static int BossSound { get; private set; } |
| | | public static Dictionary<int, int> iceCrystalMonsterScores { get; private set; } |
| | | public static float PlayBossHurtInterval { get; private set; } |
| | | public static List<int> NoXpDungeons { get; private set; } |
| | | public static List<int> RandomJobs { get; private set; } |
| | | public static int elderGodTalkingTime { get; private set; } |
| | | public static int elderGodBigBoss { get; private set; } |
| | | public static List<int> PassiveSkillShow { get; private set; } |
| | | public static List<int> bossShuntMaps { get; private set; } |
| | | public static int bossShuntDays { get; private set; } |
| | | public static Dictionary<int, int[]> itemDropEffect = new Dictionary<int, int[]>(); |
| | | public static Dictionary<int, int[]> xllyDropEffect = new Dictionary<int, int[]>(); |
| | | public static Dictionary<int, int[]> xqryDropEffect = new Dictionary<int, int[]>(); |
| | | public static Dictionary<int, List<int[]>> customDropEffect = new Dictionary<int, List<int[]>>(); |
| | | public static Dictionary<int, int> dropEffectQuality = new Dictionary<int, int>(); |
| | | public static Dictionary<int, int> BuffToHitEffect = new Dictionary<int, int>(); |
| | | |
| | | |
| | | //参数int,int ,string 分别表示职业,转生等级,icon |
| | | static Dictionary<int, Dictionary<int, string>> jobHeadPortrait = new Dictionary<int, Dictionary<int, string>>(); |
| | | static Dictionary<int, Dictionary<int, string>> otherjobHeadPortrait = new Dictionary<int, Dictionary<int, string>>(); |
| | | public static Dictionary<int, int> bossWearyValues = new Dictionary<int, int>(); |
| | | public static Dictionary<int, Vector3> NpcPosOffset = new Dictionary<int, Vector3>(); |
| | | public static Dictionary<int, string> propertyIconDict = new Dictionary<int, string>(); |
| | | |
| | | public static int demonJarHintLevelLimit { get; private set; } |
| | | public static int demonJarHintLineId { get; private set; } |
| | | public static int skillPanelUnLock { get; private set; } |
| | | public static int dailyQuestRedpointLevelLimit { get; private set; } |
| | | public static int lowHpRemind { get; private set; } |
| | | public static int munekadolockLimit { get; private set; } |
| | | public static int maxItemDropEffectCount { get; private set; } |
| | | |
| | | public static int[] autoBuyItemIds; |
| | | public static int[] autoBuyItemPrices; |
| | | |
| | | public static List<int> neutralMaps = new List<int>(); |
| | | public static List<int> neutralBossMaps = new List<int>(); |
| | | |
| | | public static int demonJarRedPoint { get; private set; } |
| | | public static string LoadLV { get; private set; } |
| | | public static int MasteryLoadingLevelLimit1 { get; private set; } |
| | | public static int MasteryLoadingLevelLimit2 { get; private set; } |
| | | |
| | | public static float mainWinSkillResetTime { get; private set; } |
| | | public static Vector3 heroDialogueOffset { get; private set; } |
| | | public static Vector3 heroDialogueRotation { get; private set; } |
| | | public static float heroDialogueScale { get; private set; } |
| | | |
| | | public static List<int> ancientGrandTotalAchievements { get; private set; } |
| | | public static List<int> ancientContinueKillAchievements { get; private set; } |
| | | |
| | | public static int trialDungeonGroupChallengeTipLv { get; private set; } |
| | | public static int prayerRedpointLimitLv { get; private set; } |
| | | |
| | | public static int demonJarLevelLimit { get; private set; } |
| | | |
| | | public static int fairyLandGuideId = 82; |
| | | |
| | | public static int specialGuide41Mission { get; private set; } |
| | | public static int specialGuide41Achievement { get; private set; } |
| | | |
| | | public static int supremeRechargeVipLv { get; private set; } |
| | | |
| | | |
| | | public static int rechargeRedpointLv { get; private set; } |
| | | public static int rechargeRedpointMinLv { get; private set; } |
| | | |
| | | public static int runeTowerSweepBuyTimes { get; private set; } |
| | | public static int runeTowerSweepBuyPrice { get; private set; } |
| | | |
| | | public static int teamMatchingTimeOut { get; private set; } |
| | | |
| | | public static List<int> inGameDownLoadLevelCheckPoints = null; |
| | | public static List<int> inGameDownLoadTaskCheckPoints = null; |
| | | public static int inGameDownLoadHighLevel { get; private set; } |
| | | public static List<int> worldBossNoRebornRemindMaps = null; |
| | | public static List<int> bossHomeNoRebornRemindMaps = null; |
| | | public static List<int> elderGodNoRebornRemindMaps = null; |
| | | public static List<int> demonJarNoRebornRemindMaps = null; |
| | | public static List<int> dogzNoRebornRemindMaps = null; |
| | | |
| | | public static string[][] ModeDefaultConfig { get; private set; } |
| | | public static int[][] PreloadSkillEffect { get; private set; } |
| | | public static int[] RealmGroup { get; private set; } |
| | | public static float PrefightAtkRange { get; private set; } |
| | | |
| | | public static Dictionary<int, string> multipleRealmImgDict { get; private set; } |
| | | public static int[] ImportantItemType { get; private set; } |
| | | public static int[] ImportantItemID { get; private set; } |
| | | |
| | | public static int inGameDownLoadHighestLevelPoint { get; private set; } |
| | | |
| | | public static List<int> dungeonCanUseMoneyIds { get; private set; } |
| | | public static int dogzBoxLimit { get; private set; } |
| | | |
| | | public static Dictionary<int, int> dungeonRebornClientTimes { get; private set; } |
| | | |
| | | public static int[] CompareEquipPlaces { get; private set; } |
| | | public static Dictionary<int, int> fairyGrabBossMapLines { get; private set; } |
| | | |
| | | public static Dictionary<int, List<int>> DropItemEffectMapID { get; private set; } |
| | | public static Dictionary<int, List<int>> itemPutInPackDict { get; private set; } |
| | | public static List<int> RebornAutoFightMapID { get; private set; } |
| | | |
| | | public static string teamWorldCall; |
| | | public static int teamWorldCallInviteCount; |
| | | |
| | | // public static List<Item> ancientKingAwards = new List<Item>(); |
| | | |
| | | public static int lowQualityEffectCount { get; private set; } |
| | | public static int medQualityEffectCount { get; private set; } |
| | | public static int highQualityEffectCount { get; private set; } |
| | | public static int lowQualityPetCount { get; private set; } |
| | | public static int medQualityPetCount { get; private set; } |
| | | public static int highQualityPetCount { get; private set; } |
| | | public static int lowQualityGuardCount { get; private set; } |
| | | public static int medQualityGuardCount { get; private set; } |
| | | public static int highQualityGuardCount { get; private set; } |
| | | public static int lowQualityPetEffectCount { get; private set; } |
| | | public static int medQualityPetEffectCount { get; private set; } |
| | | public static int highQualityPetEffectCount { get; private set; } |
| | | public static int lowQualityHorseEffectCount { get; private set; } |
| | | public static int medQualityHorseEffectCount { get; private set; } |
| | | public static int highQualityHorseEffectCount { get; private set; } |
| | | |
| | | public static int GatherSoulDZ { get; private set; } |
| | | |
| | | public static int fairyLandBuffCondition { get; private set; } |
| | | public static int fairyLandBuffId { get; private set; } |
| | | public static int achievementEarlierStageLevel { get; private set; } |
| | | public static int demonJarAutoTime { get; private set; } |
| | | // public static Dictionary<int, Dictionary<int, GA_NpcFightSgzcZZ.EquipRandomInfo>> SgzzRobotEquipDict { get; private set; } |
| | | public static Dictionary<int, int> SgzcRealm { get; private set; } |
| | | |
| | | public static int crossServerOneVsOneOpenDay { get; set; } |
| | | public static int crossServerBattleFieldOpenDay { get; private set; } |
| | | public static Dictionary<int, int> itemMoneyCountDict { get; private set; } //背包中用于展示货币数量的物品 |
| | | |
| | | public static int UISpringDecorate { get; private set; } |
| | | public static Dictionary<int, List<int>> skillAttrIDDict { get; private set; } |
| | | public static int mixServerCustomDays { get; private set; } |
| | | public static float ClientPvpAttributePer { get; private set; } |
| | | public static int openServerCustomDays { get; private set; } |
| | | |
| | | public static int mysteryShopRefreshItem { get; private set; } |
| | | public static Dictionary<int, int> mysteryShopRefreshItemCount { get; private set; } |
| | | public static int mysteryShopRefreshItemValue { get; private set; } |
| | | public static int mysteryShopRefreshInterval { get; private set; } |
| | | public static Dictionary<int, Dictionary<int, int>> equipStarLimit { get; private set; } |
| | | public static int equipTrainMustItemId { get; private set; } |
| | | public static int acutionItemHour { get; private set; } |
| | | |
| | | public static int mainWinTopCloseTime { get; private set; } |
| | | public static List<int> equipDecomposeScreen = new List<int>(); |
| | | public static Dictionary<int, float> AtkTypeIncreasePushDis = new Dictionary<int, float>(); |
| | | // public static Dictionary<int, CameraController.LookAtData> NpcDieSetCamera = new Dictionary<int, CameraController.LookAtData>(); |
| | | public static int BlueEquipJumpLevel { get; private set; } |
| | | public static int[] defenseGetWays { get; private set; } |
| | | public static Dictionary<int, int> skillYinjis { get; private set; } |
| | | public static List<int> onlyUsedAtBackpackItems { get; private set; } |
| | | public static List<int> signInPromoteSkills = new List<int>(); |
| | | public static List<int> chestDisplayItems = new List<int>(); |
| | | |
| | | public static int equipStarUpAmendFactor { get; private set; } |
| | | public static int equipStarDownAmendFactor { get; private set; } |
| | | |
| | | public static int normalEquipStarUpgradeRateCeiling { get; private set; } |
| | | public static int normalEquipStarUpgradeRateFloor { get; private set; } |
| | | |
| | | public static int suitEquipStarUpgradeRateCeiling { get; private set; } |
| | | public static int suitEquipStarUpgradeRateFloor { get; private set; } |
| | | |
| | | public static Dictionary<int, List<int>> BossAssistAward { get; private set; } |
| | | public static Dictionary<int, List<int>> FBAssistAward { get; private set; } |
| | | |
| | | //检测是否在systemsetwin prefab显示切换区服和切换账号 |
| | | public static List<string> checkShowSwitchAccount = new List<string>(); |
| | | //竞技场 初始积分|最高积分 |
| | | public static List<int> ArenaSetList { get; private set; } |
| | | //培养对应物品列表 1.培养丹2.养神石3.特殊培养 |
| | | public static int[] HorseTrainIDList { get; private set; } |
| | | public static int[] PetTrainIDList { get; private set; } |
| | | public static Dictionary<int, List<int>> LingQiTrainIDList { get; private set; } |
| | | |
| | | //数值1:可对敌方使用的附加技能列表 |
| | | //数值2:可对自己使用的附加技能列表 |
| | | //数值3:不可释放的技能 |
| | | public static int[] WorkForEnemySkills { get; private set; } |
| | | public static int[] WorkForMeSkills { get; private set; } |
| | | public static int[] WorkNotSkills { get; private set; } |
| | | public static Dictionary<int, List<int>> ZhanLingCtgIdDict { get; private set; } |
| | | public static Dictionary<int, List<int>> ZhanLingCtgIdHDict { get; private set; } |
| | | public static Dictionary<int, int> OldZhanLingCtgIdDict { get; private set; } |
| | | |
| | | public static float fightPowerMore; //战力超过比例才可快速挑战 |
| | | public static int[] flashOpenArr; //开启雷诛层 [天星塔,境界塔,符印塔(按第几个塔算)] |
| | | public static int[] flashCntMoreArr; //雷诛更多次数层需求 [天星塔,境界塔,符印塔(按第几个塔算)] |
| | | public static int flashKillMaxCount; //雷诛最大次数 |
| | | |
| | | public static readonly int HundredMillion = 100000000;//1亿 |
| | | public static int mysteryShopRefreshInterval { get; private set; } |
| | | |
| | | public static int acutionItemHour { get; private set; } |
| | | public static int maxXBGridCount { get; private set; } |
| | | |
| | | |
| | | public static void Init() |
| | | { |
| | | try |
| | | { |
| | | MoneyDisplayModel = ConfigParse.ParseIntDict(GetInputString("MoneyDisplayModel", 1)); |
| | | // equipStarUpAmendFactor = GetIntArray("EquipStarRate")[0]; |
| | | // equipStarDownAmendFactor = GetIntArray("EquipStarRate")[1]; |
| | | |
| | |
| | | // checkShowSwitchAccount.Add(item.ToString()); |
| | | // } |
| | | |
| | | // var putInItemPack = FuncConfigConfig.Get("PutInItemPack"); |
| | | // LitJson.JsonData itemPutInData = LitJson.JsonMapper.ToObject(putInItemPack.Numerical1); |
| | | // itemPutInPackDict = new Dictionary<int, List<int>>(); |
| | | // foreach (var _key in itemPutInData.Keys) |
| | | // { |
| | | // var itemTypeData = itemPutInData[_key]; |
| | | // int packType = int.Parse(_key); |
| | | // List<int> itemTypes = new List<int>(); |
| | | // itemPutInPackDict.Add(packType, itemTypes); |
| | | // if (itemTypeData.IsArray) |
| | | // { |
| | | // for (i = 0; i < itemTypeData.Count; i++) |
| | | // { |
| | | // int itemType = int.Parse(itemTypeData[i].ToString()); |
| | | // itemTypes.Add(itemType); |
| | | // } |
| | | // } |
| | | // } |
| | | var putInItemPack = FuncConfigConfig.Get("PutInItemPack"); |
| | | LitJson.JsonData itemPutInData = LitJson.JsonMapper.ToObject(putInItemPack.Numerical1); |
| | | itemPutInPackDict = new Dictionary<int, List<int>>(); |
| | | foreach (var _key in itemPutInData.Keys) |
| | | { |
| | | var itemTypeData = itemPutInData[_key]; |
| | | int packType = int.Parse(_key); |
| | | List<int> itemTypes = new List<int>(); |
| | | itemPutInPackDict.Add(packType, itemTypes); |
| | | if (itemTypeData.IsArray) |
| | | { |
| | | for (int i = 0; i < itemTypeData.Count; i++) |
| | | { |
| | | int itemType = int.Parse(itemTypeData[i].ToString()); |
| | | itemTypes.Add(itemType); |
| | | } |
| | | } |
| | | } |
| | | |
| | | itemMoneyCountDict = ConfigParse.ParseIntDict(putInItemPack.Numerical2); |
| | | |
| | | // //拾取贵重物品 |
| | | // FuncConfigConfig importantItemType = FuncConfigConfig.Get("AutoBuyDrug"); |
| | |
| | | |
| | | public static long GetFactValue(uint value, uint valueEx) |
| | | { |
| | | return (long)valueEx * HundredMillion +(long)value; |
| | | return (long)valueEx * (long)Constants.ExpPointValue +(long)value; |
| | | } |
| | | } |
| | |
| | | public void QueryUnLockHeroPack() |
| | | { |
| | | //解锁更多的武将背包 |
| | | int canBuyCnt = PackManager.Instance.GetCanBuyPackGirdCount(PackType.Hero); |
| | | if (canBuyCnt <= 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("HeroPack1", GeneralDefine.MoneyDisplayModel[1],1, 1), (bool isOK)=> |
| | | { |
| | | |
| | | }); |
| | | } |
| | | |
| | | //刷新时机, 打开武将界面 或者 关闭功能界面 |
New file |
| | |
| | | using System;
|
| | | using LitJson;
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
|
| | | /// <summary>
|
| | | /// 宝箱功能 + 获取奖励界面
|
| | | /// </summary>
|
| | | public class BoxGetItemModel : GameSystemManager<BoxGetItemModel>
|
| | | {
|
| | |
|
| | | List<string> commonShowAwardEvents = new List<string>(); //获取奖励的展示事件
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | var config = FuncConfigConfig.Get("CommonShowAwards");
|
| | | commonShowAwardEvents = JsonMapper.ToObject<List<string>>(config.Numerical1);
|
| | | }
|
| | |
|
| | | // void OnBeforePlayerDataInitialize()
|
| | | // {
|
| | | // getItems = null;
|
| | | // getCoinsType = 0;
|
| | | // getCoinsCnt = 0;
|
| | | // }
|
| | |
|
| | | #region 处理服务器数据
|
| | |
|
| | | // public BoxGetItemInfo[] getItems { get; private set; }
|
| | | // public int getCoinsType { get; private set; }
|
| | | // public long getCoinsCnt { get; private set; }
|
| | | // public event Action<int, int, BoxGetItemInfo[]> RefreshGetItemAct;
|
| | | // public void SetGetBoxItemInfo(HA810_tagMCNotifyUseItemGetItem boxItemInfo)
|
| | | // {
|
| | | // getItems = JsonMapper.ToObject<BoxGetItemInfo[]>(boxItemInfo.GetItemData);
|
| | | // getCoinsType = boxItemInfo.MoneyType;
|
| | | // getCoinsCnt = boxItemInfo.MoneyCount;
|
| | | // if (!NewBieCenter.Instance.inGuiding)
|
| | | // {
|
| | | // List<Item> items = new List<Item>();
|
| | | // for (int i = 0; i < getItems.Length; i++)
|
| | | // {
|
| | | // BoxGetItemInfo info = getItems[i];
|
| | | // Dictionary<int, List<int>> useDataDic = ConfigParse.Analysis(info.UserData);
|
| | | // if (useDataDic != null && useDataDic.TryGetValue((int)ItemUseDataKey.itemCount, out List<int> list) && list != null && list.Count > 0)
|
| | | // {
|
| | | // int count = list[0];
|
| | | // items.Add(new Item(info.ItemID, count));
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // items.Add(new Item(info.ItemID, info.Count));
|
| | | // }
|
| | |
|
| | | // }
|
| | | // ItemLogicUtility.Instance.ShowGetItem(items, seconds: 0);
|
| | | // }
|
| | |
|
| | | // if (RefreshGetItemAct != null)
|
| | | // {
|
| | | // RefreshGetItemAct((int)boxItemInfo.UseItemID, (int)boxItemInfo.UseCount, getItems);
|
| | | // }
|
| | |
|
| | |
|
| | | // }
|
| | |
|
| | | //获得奖励展示
|
| | | public void ReceiveAwardNotify(HA801_tagMCGiveAwardInfo netPack)
|
| | | {
|
| | | var eventName = UIHelper.ServerStringTrim(netPack.EventName);
|
| | |
|
| | | // 仙盟攻城战
|
| | | // if (eventName == "FamilyGCZSQGrid" || eventName == "FamilyGCZSQPass" || eventName == "FamilyGCZSQPassAll" ||
|
| | | // eventName == "FamilyGCZContiribution" || eventName == "FamilyGCZAtk")
|
| | | // {
|
| | | // ModelCenter.Instance.GetModel<FairySiegeActModel>()?.OnUpdateAwardInfoAction(netPack);
|
| | | // return;
|
| | | // }
|
| | | if (!commonShowAwardEvents.Contains(eventName))
|
| | | return;
|
| | |
|
| | | List<Item> showItems = new List<Item>();
|
| | |
|
| | | if (netPack.Exp != 0 || netPack.ExpPoint != 0)
|
| | | {
|
| | | ulong expValue = netPack.Exp + netPack.ExpPoint * (ulong)Constants.ExpPointValue;
|
| | | showItems.Add(new Item(GeneralDefine.expDisplayId, expValue));
|
| | | }
|
| | | if (netPack.MoneyList.Length != 0)
|
| | | {
|
| | | for (int i = 0; i < netPack.MoneyLen; i++)
|
| | | {
|
| | | var moneyType = netPack.MoneyList[i].MoneyType;
|
| | | if (GeneralDefine.moneyDisplayIds.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0)
|
| | | {
|
| | | showItems.Add(new Item(GeneralDefine.moneyDisplayIds[moneyType], netPack.MoneyList[i].MoneyValue));
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | if (netPack.ItemList.Length != 0)
|
| | | {
|
| | | for (int i = 0; i < netPack.ItemLen; i++)
|
| | | {
|
| | | showItems.Add(new Item((int)netPack.ItemList[i].ItemID, netPack.ItemList[i].Count, netPack.ItemList[i].IsBind));
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | string info = string.Empty;
|
| | | if (LanguageConfig.HasKey("commonShowAwardEvents_" + eventName))
|
| | | info = Language.Get("commonShowAwardEvents_" + eventName);
|
| | |
|
| | | if (showItems.Count == 0)
|
| | | return;
|
| | |
|
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, eventName);
|
| | | }
|
| | |
|
| | | // public int GetUseCntByID(int itemId)
|
| | | // {
|
| | | // return PackManager.Instance.GetItemUsedTimesToday(itemId);
|
| | | // }
|
| | |
|
| | | #endregion
|
| | |
|
| | | // #region 消耗材料货币开启的宝箱
|
| | | // public void SetModel(string guid, int itemId)
|
| | | // {
|
| | | // ChestsConfig chestsConfig = ChestsConfig.Get(itemId);
|
| | | // this.guid = guid;
|
| | | // this.itemId = itemId;
|
| | | // if (guid == "" || chestsConfig == null) return;
|
| | |
|
| | | // ItemConfig boxConfig = ItemConfig.Get(itemId);
|
| | | // if (PlayerDatas.Instance.baseData.LV < boxConfig.UseLV)
|
| | | // {
|
| | | // ServerTipDetails.DisplayNormalTip(Language.Get("MakeUseItem101", boxConfig.UseLV));
|
| | | // return;
|
| | | // }
|
| | |
|
| | | // CheckOpenBoxCondi(guid, itemId);
|
| | | // }
|
| | |
|
| | | // public void CheckOpenBoxCondi(string guid, int itemId, int useCnt = 1)
|
| | | // {
|
| | | // ChestsConfig chestsConfig = ChestsConfig.Get(itemId);
|
| | | // if (chestsConfig == null) return;
|
| | |
|
| | | // ItemConfig boxConfig = ItemConfig.Get(itemId);
|
| | |
|
| | | // if (chestsConfig.ExpendItemID != 0)
|
| | | // {
|
| | | // ItemConfig itemConfig = ItemConfig.Get(chestsConfig.ExpendItemID);
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("OpenBoxTool", itemConfig.ItemName), (bool isOk) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | // if (!IsEnoughTools(chestsConfig.ExpendItemID, chestsConfig.ExpendCount * useCnt))
|
| | | // {
|
| | | // SysNotifyMgr.Instance.ShowTip("OpenBoxToolNoEnough", itemConfig.ItemName);
|
| | | // return;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // CheckOpenMoney(chestsConfig, boxConfig, useCnt);
|
| | | // }
|
| | | // }
|
| | | // });
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // CheckOpenMoney(chestsConfig, boxConfig, useCnt);
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void CheckOpenMoney(ChestsConfig chestsConfig, ItemConfig boxConfig, int useCnt)
|
| | | // {
|
| | | // if (!IsEnoughMoney(chestsConfig.OpenMoney * useCnt))
|
| | | // {
|
| | | // SysNotifyMgr.Instance.ShowTip("BoxOpenCostMoney", 1);
|
| | | // return;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (chestsConfig.OpenMoney > 0)
|
| | | // {
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("OpenBoxGold", chestsConfig.OpenMoney * useCnt), (bool isOk) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | // CheckOtherCondi(chestsConfig, boxConfig, useCnt);
|
| | | // }
|
| | | // });
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // CheckOtherCondi(chestsConfig, boxConfig, useCnt);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void CheckOtherCondi(ChestsConfig chestsConfig, ItemConfig boxConfig, int useCnt)
|
| | | // {
|
| | |
|
| | | // if (boxConfig.MaxSkillCnt > 0 && GetUseCntByID(itemId) >= boxConfig.MaxSkillCnt)
|
| | | // {
|
| | | // SysNotifyMgr.Instance.ShowTip("UseCntLimit");
|
| | | // return;
|
| | | // }
|
| | |
|
| | | // if (IsSelectItemByID(itemId))
|
| | | // {
|
| | | // UIManager.Instance.OpenWindow<ChooseItemsWin>();
|
| | | // return;
|
| | | // }
|
| | |
|
| | | // ItemLogicUtility.Instance.UseItem(guid, useCnt);
|
| | | // }
|
| | |
|
| | | // public bool CheckOpenBoxCondition(int itemId, out bool isBox)
|
| | | // {
|
| | | // isBox = false;
|
| | | // ChestsConfig chestsConfig = ChestsConfig.Get(itemId);
|
| | | // if (chestsConfig == null) return false;
|
| | |
|
| | | // isBox = true;
|
| | | // bool isCanOpen = true;
|
| | | // ItemConfig boxConfig = ItemConfig.Get(itemId);
|
| | | // if (PlayerDatas.Instance.baseData.LV < boxConfig.UseLV)
|
| | | // {
|
| | | // isCanOpen = false;
|
| | | // return isCanOpen;
|
| | | // }
|
| | |
|
| | | // if (chestsConfig.ExpendItemID != 0)
|
| | | // {
|
| | | // ItemConfig itemConfig = ItemConfig.Get(chestsConfig.ExpendItemID);
|
| | | // if (!IsEnoughTools(chestsConfig.ExpendItemID, chestsConfig.ExpendCount))
|
| | | // {
|
| | | // isCanOpen = false;
|
| | | // return isCanOpen;
|
| | | // }
|
| | | // }
|
| | |
|
| | | // if (!IsEnoughMoney(chestsConfig.OpenMoney))
|
| | | // {
|
| | | // isCanOpen = false;
|
| | | // return isCanOpen;
|
| | | // }
|
| | |
|
| | | // if (boxConfig.MaxSkillCnt > 0 && GetUseCntByID(itemId) >= boxConfig.MaxSkillCnt)
|
| | | // {
|
| | | // isCanOpen = false;
|
| | | // return isCanOpen;
|
| | | // }
|
| | |
|
| | | // return isCanOpen;
|
| | | // }
|
| | |
|
| | | // private bool IsEnoughMoney(int moneyCnt)
|
| | | // {
|
| | | // ulong haveMoney = UIHelper.GetMoneyCnt(1);
|
| | | // if (haveMoney >= (ulong)moneyCnt)
|
| | | // {
|
| | | // return true;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // return false;
|
| | | // }
|
| | | // }
|
| | |
|
| | | // private bool IsEnoughTools(int itemId, int toolCnt)
|
| | | // {
|
| | | // int count = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
|
| | | // if (count >= toolCnt)
|
| | | // {
|
| | | // return true;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // return false;
|
| | | // }
|
| | | // }
|
| | | // #endregion
|
| | |
|
| | | //宝箱预览物品 (随机获得)
|
| | | public List<Item> GetBoxItems(int boxID)
|
| | | {
|
| | | List<Item> itemIDs = new List<Item>();
|
| | |
|
| | | if (ChestsAwardConfig.GetBoxType(boxID) == 0)
|
| | | {
|
| | | return itemIDs;
|
| | | }
|
| | |
|
| | | var config = ChestsAwardConfig.GetChestsAwardByID(boxID);
|
| | |
|
| | | if (!string.IsNullOrEmpty(config.SelectList))
|
| | | {
|
| | | var selectlistDict = ConfigParse.GetDic<int, int>(config.SelectList);
|
| | | foreach (var item in selectlistDict)
|
| | | {
|
| | | itemIDs.Add(new Item(item.Key, (ulong)item.Value));
|
| | | }
|
| | | }
|
| | |
|
| | | if (!string.IsNullOrEmpty(config.FixedItem))
|
| | | {
|
| | | var itemListDict = ConfigParse.GetDic<int, int>(config.FixedItem);
|
| | | foreach (var item in itemListDict)
|
| | | {
|
| | | itemIDs.Add(new Item(item.Key, (ulong)item.Value));
|
| | | }
|
| | | }
|
| | |
|
| | | if (!string.IsNullOrEmpty(config.Probability1))
|
| | | {
|
| | | var arr = JsonMapper.ToObject(config.Probability1);
|
| | |
|
| | | for (int i = 0; i < arr.Count; i++)
|
| | | {
|
| | | itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), ulong.Parse(arr[i][1][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | | if (!string.IsNullOrEmpty(config.Probability2))
|
| | | {
|
| | | var arr = JsonMapper.ToObject(config.Probability2);
|
| | |
|
| | | for (int i = 0; i < arr.Count; i++)
|
| | | {
|
| | | itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), ulong.Parse(arr[i][1][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | | return itemIDs;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | #region 自选物品宝箱
|
| | |
|
| | | //<物品ID,数量> 用户选中物品字典
|
| | | public Dictionary<int, ChooseItems> userChooseItemDict = new Dictionary<int, ChooseItems>();
|
| | | public Action countChangeAction; //数量发生变化
|
| | |
|
| | | public bool IsSelectItemByID(int boxId)
|
| | | {
|
| | | ChestsAwardConfig awardConfig = ChestsAwardConfig.GetChestsAwardByID(boxId);
|
| | | if (string.IsNullOrEmpty(awardConfig.SelectList))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public int[][] GetSelectItemsByID(int boxId)
|
| | | {
|
| | | ChestsAwardConfig awardConfig = ChestsAwardConfig.GetChestsAwardByID(boxId);
|
| | | if (string.IsNullOrEmpty(awardConfig.SelectList))
|
| | | {
|
| | | return null;
|
| | | }
|
| | | var arr = ConfigParse.GetArray2<int>(awardConfig.SelectList);
|
| | | Array.Sort(arr, SortShowItem);
|
| | | return arr;
|
| | | }
|
| | |
|
| | | int SortShowItem(int[] a, int[] b)
|
| | | {
|
| | | var itemConfig1 = ItemConfig.Get(a[0]);
|
| | | var itemConfig2 = ItemConfig.Get(b[0]);
|
| | | int quality1 = itemConfig1.ItemColor;
|
| | | int quality2 = itemConfig2.ItemColor;
|
| | | //品质高的排在前面
|
| | | if (quality1 != quality2)
|
| | | return quality2.CompareTo(quality1);
|
| | | return itemConfig1.ID - itemConfig2.ID;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 选择自选物品数量
|
| | | /// </summary>
|
| | | /// <param name="itemId">被选择物品的ID</param>
|
| | | /// <param name="guid">宝箱的GUID</param>
|
| | | /// <param name="extra"></param>
|
| | | /// <param name="changeCnt">加减数量</param>
|
| | | public void IncreaseUserChooseItemCount(int itemId, string guid, int extra, int changeCnt)
|
| | | {
|
| | | if (userChooseItemDict.ContainsKey(itemId))
|
| | | {
|
| | | userChooseItemDict[itemId].guid = guid;
|
| | | userChooseItemDict[itemId].useCnt = userChooseItemDict[itemId].useCnt + changeCnt;
|
| | | userChooseItemDict[itemId].extra = extra;
|
| | | }
|
| | | else
|
| | | {
|
| | | userChooseItemDict[itemId] = new ChooseItems() { guid = guid, useCnt = 1, extra = extra };
|
| | | }
|
| | | countChangeAction?.Invoke();
|
| | | }
|
| | |
|
| | |
|
| | | //当前选择材料总数量
|
| | | public int GetNowChooseItemCount()
|
| | | {
|
| | | int total = 0;
|
| | | if (userChooseItemDict == null && userChooseItemDict.Count == 0)
|
| | | return 0;
|
| | | List<int> list = new List<int>(userChooseItemDict.Keys);
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | total += userChooseItemDict[list[i]].useCnt;
|
| | | return total;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public bool TrySendUse()
|
| | | {
|
| | | CA323_tagCMUseItems.tagCMUseItemsSelect[] chooseItemList = GetSendList(userChooseItemDict, out List<ChooseItems> resultChooseItemDict, out string guid, out int count);
|
| | | //一个材料也没选
|
| | | if (chooseItemList.Length < 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ChooseItems01");
|
| | | return false;
|
| | | }
|
| | |
|
| | | var itemModel = PackManager.Instance.GetItemByGuid(guid);
|
| | | if (itemModel == null)
|
| | | return false;
|
| | |
|
| | | for (int i = 0; i < resultChooseItemDict.Count; i++)
|
| | | {
|
| | | var item = PackManager.Instance.GetItemByGuid(resultChooseItemDict[i].guid);
|
| | | if (item == null)
|
| | | return false;
|
| | |
|
| | | var error = 0;
|
| | | if (!ItemLogicUtility.Instance.CanUseItem(resultChooseItemDict[i].guid, resultChooseItemDict[i].useCnt, out error))
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | case 1:
|
| | | SysNotifyMgr.Instance.ShowTip("EverydayUseLimit");
|
| | | break;
|
| | | case 2:
|
| | | SysNotifyMgr.Instance.ShowTip("UseCntLimit");
|
| | | break;
|
| | | case 3:
|
| | | SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_749572");
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | var useItem = new CA323_tagCMUseItems();
|
| | | useItem.ItemIndex = (byte)itemModel.gridIndex;
|
| | | useItem.UseCnt = (ushort)count;
|
| | | useItem.ExData = (uint)0;
|
| | | useItem.SelectCount = (byte)chooseItemList.Length;
|
| | | useItem.SelectList = chooseItemList;
|
| | | GameNetSystem.Instance.SendInfo(useItem); |
| | | return true;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | CA323_tagCMUseItems.tagCMUseItemsSelect[] GetSendList(Dictionary<int, ChooseItems> userChooseItemDict, out List<ChooseItems> resultChooseItemDict, out string guid, out int count)
|
| | | {
|
| | | guid = string.Empty;
|
| | | count = 0;
|
| | | resultChooseItemDict = new List<ChooseItems> { };
|
| | | List<int> list = new List<int>(userChooseItemDict.Keys);
|
| | | List<ChooseItems> result = new List<ChooseItems>();
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | int itemId = list[i];
|
| | | ChooseItems chooseItems = userChooseItemDict[itemId];
|
| | | if (!ItemConfig.HasKey(itemId))
|
| | | continue;
|
| | | if (chooseItems == null || chooseItems.useCnt <= 0)
|
| | | continue;
|
| | | count += chooseItems.useCnt;
|
| | | result.Add(chooseItems);
|
| | | }
|
| | | resultChooseItemDict = result;
|
| | | if (!result.IsNullOrEmpty())
|
| | | guid = result[0].guid;
|
| | |
|
| | | List<CA323_tagCMUseItems.tagCMUseItemsSelect> tagCMUseItemsSelects = new List<CA323_tagCMUseItems.tagCMUseItemsSelect>();
|
| | | for (int i = 0; i < result.Count; i++)
|
| | | {
|
| | | CA323_tagCMUseItems.tagCMUseItemsSelect temp = new CA323_tagCMUseItems.tagCMUseItemsSelect();
|
| | | temp.SelectID = (uint)result[i].extra;
|
| | | temp.SelectCnt = (ushort)result[i].useCnt;
|
| | | tagCMUseItemsSelects.Add(temp);
|
| | | }
|
| | |
|
| | | return tagCMUseItemsSelects.ToArray();
|
| | | }
|
| | |
|
| | | public void ClearAll()
|
| | | {
|
| | | userChooseItemDict.Clear();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | |
|
| | | |
| | | }
|
| | |
|
| | |
|
| | | public class BoxGetItemInfo
|
| | | {
|
| | | public int ItemID;
|
| | | public int Count;
|
| | | public int IsBind;
|
| | | public int IsSuite;
|
| | | public string UserData;
|
| | | }
|
| | |
|
| | | public class ChooseItems
|
| | | {
|
| | | public string guid;
|
| | | public int useCnt;
|
| | | public int extra;
|
| | | } |
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/System/ItemTip/BoxGetItemModel.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: 2eb8c13a1ade0ce458b63f0ca368758c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class BoxItemCell : MonoBehaviour |
| | | { |
| | | [SerializeField] ItemCell itemCell; |
| | | [SerializeField] Text nameText; |
| | | |
| | | public void Display(Item item) |
| | | { |
| | | int itemID = item.id; |
| | | itemCell.Init(new ItemCellModel(itemID, false, item.countEx)); |
| | | itemCell.button.AddListener(()=> |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | nameText.text = ItemConfig.Get(itemID).ItemName; |
| | | } |
| | | } |
| | | |
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/System/ItemTip/BoxItemCell.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: bb169f4e43327164c8aa0a1cfeecdad1 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | |
| | | public class BoxItemLineCell : CellView |
| | | { |
| | | [SerializeField] BoxItemCell[] itemList; |
| | | |
| | | public void Display(List<Item> list) |
| | | { |
| | | for (int i = 0; i < itemList.Length; i++) |
| | | { |
| | | if (i < list.Count) |
| | | { |
| | | itemList[i].SetActive(true); |
| | | itemList[i].Display(list[i]); |
| | | } |
| | | else |
| | | { |
| | | itemList[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/System/ItemTip/BoxItemLineCell.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: a4e421d1b43c43741a77780e74104218 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 随机宝箱:区分是真物品,还是预览 |
| | | /// 支持同时打开多个界面 |
| | | /// </summary> |
| | | public class BoxItemWin : UIBase |
| | | { |
| | | |
| | | [SerializeField] ItemCell itemCell; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Text descText; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] SliderPanel sliderPanel; |
| | | [SerializeField] Button openButton; |
| | | |
| | | [SerializeField] CellView _InitCell; |
| | | |
| | | string guid; |
| | | int itemID; |
| | | int itemCount; |
| | | int useCnt; |
| | | List<Item> items; |
| | | protected override void InitComponent() |
| | | { |
| | | openButton.AddListener(() => |
| | | { |
| | | ItemLogicUtility.Instance.UseItem(guid, useCnt); |
| | | }); |
| | | } |
| | | |
| | | protected override void Start() |
| | | { |
| | | _InitCell.cellIdentifier = _InitCell.cellIdentifier + this.GetInstanceID().ToString(); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | itemID = ItemTipUtility.mainTipData.baseInfo.itemId; |
| | | itemCount = ItemTipUtility.mainTipData.baseInfo.count; |
| | | guid = ItemTipUtility.mainTipData.guid; |
| | | |
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)itemCount)); |
| | | var itemConfig = ItemConfig.Get(itemID); |
| | | nameText.text = itemConfig.ItemName; |
| | | descText.text = itemConfig.Description; |
| | | |
| | | if (string.IsNullOrEmpty(guid)) |
| | | { |
| | | openButton.SetActive(false); |
| | | sliderPanel.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | openButton.SetActive(true); |
| | | sliderPanel.SetActive(true); |
| | | } |
| | | |
| | | sliderPanel.Init((value) => { useCnt = value; }, itemCount); |
| | | |
| | | |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | items = BoxGetItemModel.Instance.GetBoxItems(itemID); |
| | | CreateScroller(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | scroller.Refresh(); |
| | | |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | if (i % 4 == 0) |
| | | { |
| | | List<Item> tmpIDs = new List<Item>(); |
| | | for (int j = 0; j < 4; j++) |
| | | { |
| | | int index = i + j; |
| | | if (index >= items.Count) |
| | | break; |
| | | tmpIDs.Add(items[index]); |
| | | } |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as BoxItemLineCell; |
| | | |
| | | List<Item> tmpIDs = new List<Item>(); |
| | | for (int j = 0; j < 4; j++) |
| | | { |
| | | int index = cell.index + j; |
| | | if (index >= items.Count) |
| | | break; |
| | | tmpIDs.Add(items[index]); |
| | | } |
| | | |
| | | _cell.Display(tmpIDs); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/System/ItemTip/BoxItemWin.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: b86f5d8b940c1c34cabe4876cd7993be |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | |
|
| | | public class ChooseItemsCell : CellView
|
| | | {
|
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] TextEx txtItemName;
|
| | | [SerializeField] TextEx txtNumber;
|
| | | [SerializeField] LongPressButton btnReduce;
|
| | | [SerializeField] LongPressButton btnPlus;
|
| | | [SerializeField] Transform numForm;
|
| | |
|
| | | int itemId;
|
| | | string guid;
|
| | |
|
| | | public void Display(int[] itemArr, string _guid )
|
| | | {
|
| | | this.itemId = itemArr[0];
|
| | | this.guid = _guid;
|
| | | ItemConfig itemConfig = ItemConfig.Get(itemId);
|
| | | int count = itemArr[1];
|
| | | itemCell.Init(new ItemCellModel(itemId, false, (ulong)count));
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemId);
|
| | | });
|
| | | txtItemName.text = itemConfig.ItemName;
|
| | | txtNumber.text = BoxGetItemModel.Instance.userChooseItemDict.ContainsKey(itemId) ? BoxGetItemModel.Instance.userChooseItemDict[itemId].useCnt.ToString() : "0";
|
| | |
|
| | | if (string.IsNullOrEmpty(guid))
|
| | | {
|
| | | numForm.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | numForm.SetActive(true);
|
| | | btnPlus.onPress.RemoveAllListeners();
|
| | | btnPlus.SetListener(OnClickPlus);
|
| | | btnPlus.onPress.AddListener(OnClickPlus);
|
| | | btnReduce.onPress.RemoveAllListeners();
|
| | | btnReduce.SetListener(OnClickReduce);
|
| | | btnReduce.onPress.AddListener(OnClickReduce);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnClickPlus()
|
| | | {
|
| | | ItemModel itemModel = PackManager.Instance.GetItemByGuid(guid);
|
| | | if (itemModel == null)
|
| | | return;
|
| | |
|
| | | if (BoxGetItemModel.Instance.GetNowChooseItemCount() >= itemModel.count)
|
| | | return;
|
| | | BoxGetItemModel.Instance.IncreaseUserChooseItemCount(itemId, itemModel.guid, itemId, 1);
|
| | | txtNumber.text = BoxGetItemModel.Instance.userChooseItemDict.ContainsKey(itemId) ? BoxGetItemModel.Instance.userChooseItemDict[itemId].useCnt.ToString() : "0";
|
| | | |
| | | }
|
| | |
|
| | | void OnClickReduce()
|
| | | {
|
| | | ItemModel itemModel = PackManager.Instance.GetItemByGuid(guid);
|
| | | if (itemModel == null)
|
| | | return;
|
| | | if (!BoxGetItemModel.Instance.userChooseItemDict.ContainsKey(itemId))
|
| | | return;
|
| | | if (BoxGetItemModel.Instance.userChooseItemDict[itemId].useCnt <= 0)
|
| | | return;
|
| | | BoxGetItemModel.Instance.IncreaseUserChooseItemCount(itemId, itemModel.guid, itemId, -1);
|
| | | txtNumber.text = BoxGetItemModel.Instance.userChooseItemDict.ContainsKey(itemId) ? BoxGetItemModel.Instance.userChooseItemDict[itemId].useCnt.ToString() : "0";
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
File was renamed from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: 7eacdda8b7c863e48b2ae4acd2027167 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | public class ChooseItemsWin : UIBase
|
| | | {
|
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] Text descText;
|
| | | [SerializeField] ScrollerController scroller;
|
| | | [SerializeField] Button openButton;
|
| | | [SerializeField] Text txtChooseNum;
|
| | | [SerializeField] CellView _InitCell;
|
| | |
|
| | | string guid;
|
| | | int itemID;
|
| | | int itemCount;
|
| | | int[][] selectArray;
|
| | | protected override void InitComponent()
|
| | | {
|
| | | openButton.AddListener(() =>
|
| | | {
|
| | | BoxGetItemModel.Instance.TrySendUse();
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void Start()
|
| | | {
|
| | | _InitCell.cellIdentifier = _InitCell.cellIdentifier + this.GetInstanceID().ToString();
|
| | | }
|
| | |
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | BoxGetItemModel.Instance.countChangeAction += OnCountChangeAction;
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | itemID = ItemTipUtility.mainTipData.baseInfo.itemId;
|
| | | itemCount = ItemTipUtility.mainTipData.baseInfo.count;
|
| | | guid = ItemTipUtility.mainTipData.guid;
|
| | | InitItemsData();
|
| | |
|
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)itemCount));
|
| | | var itemConfig = ItemConfig.Get(itemID);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | descText.text = itemConfig.Description;
|
| | |
|
| | | if (string.IsNullOrEmpty(guid))
|
| | | {
|
| | | //预览
|
| | | openButton.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | BoxGetItemModel.Instance.ClearAll();
|
| | | openButton.SetActive(true);
|
| | | }
|
| | |
|
| | | int nowChooseItemCount = BoxGetItemModel.Instance.GetNowChooseItemCount();
|
| | | txtChooseNum.text = Language.Get("L1100", Language.Get("L1107"),
|
| | | UIHelper.AppendColor(TextColType.DarkGreen, $"{nowChooseItemCount}/{itemCount}"));
|
| | | |
| | | CreateScroller();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | }
|
| | |
|
| | | void CreateScroller()
|
| | | {
|
| | | scroller.Refresh();
|
| | | for (int i = 0; i < selectArray.Length; i++)
|
| | | {
|
| | | scroller.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | scroller.Restart();
|
| | | }
|
| | |
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | |
|
| | | var _cell = cell as ChooseItemsCell;
|
| | | _cell.Display(selectArray[cell.index], guid);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | void InitItemsData()
|
| | | {
|
| | | selectArray = BoxGetItemModel.Instance.GetSelectItemsByID(itemID);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private void OnCountChangeAction()
|
| | | {
|
| | | int nowChooseItemCount = BoxGetItemModel.Instance.GetNowChooseItemCount();
|
| | | txtChooseNum.text = Language.Get("L1100", Language.Get("L1107"),
|
| | | UIHelper.AppendColor(TextColType.DarkGreen, $"{nowChooseItemCount}/{itemCount}"));
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
copy from Main/Component/UI/Core/DelayButton.cs.meta
copy to Main/System/ItemTip/ChooseItemsWin.cs.meta
File was copied from Main/Component/UI/Core/DelayButton.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f91c143a16d59de4b80b2b0ffbb455e4 |
| | | timeCreated: 1501494723 |
| | | licenseType: Free |
| | | guid: 80c2b6d2ef0dcfb46b0971eddae69ab7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using LitJson; |
| | | |
| | | public class ItemTipUtility |
| | | { |
| | |
| | | { |
| | | Item, |
| | | Equip, |
| | | Dogz, |
| | | GatherSoul, //废弃 |
| | | KingTreasure, //王者法宝tip |
| | | PetMount, |
| | | SpiritWeapon, |
| | | PeerlessChest, |
| | | TreasureShow, //其他法宝tip |
| | | BoxItem, //宝箱物品 |
| | | BoxItem, //宝箱随机物品 |
| | | BoxChooseItem, //宝箱自选物品 |
| | | TreasurePavilion, //古宝物品(碎片) |
| | | } |
| | | |
| | |
| | | public string guid; |
| | | public int itemId; |
| | | public int goodId; |
| | | public int exchangeItemId; |
| | | public int exchangeItemId; //部分界面要动态变化物品的情况 |
| | | |
| | | public BaseInfo baseInfo; |
| | | public BaseProperty baseProperty; |
| | |
| | | // static ItemOverdueModel itemOverdueModel { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } } |
| | | // static BoxGetItemModel boxGetItemModel { get { return ModelCenter.Instance.GetModel<BoxGetItemModel>(); } } |
| | | |
| | | public static TipData mainTipData { get; private set; } |
| | | public static TipData mainTipData { get; private set; } // 注意当递进点击打开多个tip界面会变更数据,不能依赖此值 |
| | | public static TipData secondaryData { get; private set; } |
| | | |
| | | public static void Show(int itemId) |
| | |
| | | |
| | | // secondaryData = null; |
| | | |
| | | // var config = ItemConfig.Get(itemId); |
| | | // PrintItemBrief(itemId); |
| | | var config = ItemConfig.Get(itemId); |
| | | PrintItemBrief(itemId); |
| | | |
| | | // var tipType = GetTipType(itemId); |
| | | // switch (tipType) |
| | | // { |
| | | // case TipType.Equip: |
| | | // mainTipData = CreateNormalEquipData(itemId); |
| | | // if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty))) |
| | | // { |
| | | // mainTipData.legendProperty = item.legendProperty; |
| | | // mainTipData.baseInfo.score = item.score; |
| | | // mainTipData.baseInfo.isPreview = false; |
| | | // } |
| | | var tipType = GetTipType(itemId); |
| | | switch (tipType) |
| | | { |
| | | case TipType.Equip: |
| | | // mainTipData = CreateNormalEquipData(itemId); |
| | | // if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty))) |
| | | // { |
| | | // mainTipData.legendProperty = item.legendProperty; |
| | | // mainTipData.baseInfo.score = item.score; |
| | | // mainTipData.baseInfo.isPreview = false; |
| | | // } |
| | | |
| | | // if (item.compare) |
| | | // { |
| | | // if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId)) |
| | | // { |
| | | // var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace)); |
| | | // if (equipedGuid != string.Empty) |
| | | // { |
| | | // secondaryData = CreateNormalEquipData(equipedGuid, false); |
| | | // } |
| | | // } |
| | | // } |
| | | // break; |
| | | // case TipType.Dogz: |
| | | // mainTipData = CreateDogzEquipData(itemId); |
| | | // break; |
| | | // case TipType.PeerlessChest: |
| | | // mainTipData = CreateItemData(itemId); |
| | | // mainTipData.getWay = default(GetWay); |
| | | // Dictionary<int, int> selectItems; |
| | | // if (boxGetItemModel.IsSelectItemByID(itemId, out selectItems)) |
| | | // { |
| | | // secondaryData = CreateNormalEquipData(selectItems.Keys.First()); |
| | | // secondaryData.getWay = default(GetWay); |
| | | // } |
| | | // break; |
| | | // default: |
| | | // mainTipData = CreateItemData(itemId); |
| | | // break; |
| | | // } |
| | | // if (item.compare) |
| | | // { |
| | | // if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId)) |
| | | // { |
| | | // var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace)); |
| | | // if (equipedGuid != string.Empty) |
| | | // { |
| | | // secondaryData = CreateNormalEquipData(equipedGuid, false); |
| | | // } |
| | | // } |
| | | // } |
| | | break; |
| | | default: |
| | | mainTipData = CreateItemData(itemId); |
| | | break; |
| | | } |
| | | |
| | | // mainTipData.getWay.defaultUnfold = item.unfoldGetWay; |
| | | // switch (tipType) |
| | | // { |
| | | // case TipType.Equip: |
| | | // WindowCenter.Instance.Open<EquipTipWin>(); |
| | | // break; |
| | | // case TipType.Dogz: |
| | | // WindowCenter.Instance.Open<EquipTipWin>(); |
| | | // break; |
| | | // case TipType.KingTreasure: |
| | | // var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>(); |
| | | // kingTreasureShow.SetInitData(itemId); |
| | | // break; |
| | | // case TipType.PetMount: |
| | | // WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | // break; |
| | | // case TipType.SpiritWeapon: |
| | | // WindowCenter.Instance.Open<SpiritWeaponTipWin>(); |
| | | // break; |
| | | // case TipType.PeerlessChest: |
| | | // WindowCenter.Instance.Open<PeerlessChestTipWin>(); |
| | | // break; |
| | | // case TipType.TreasureShow: |
| | | // TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>(); |
| | | // if (config.Effect1 == 232) |
| | | // { |
| | | // effectModel.SetTreasureID(config.EffectValueA1, 0); |
| | | // } |
| | | // break; |
| | | // case TipType.BoxItem: |
| | | // if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>()) |
| | | // { |
| | | // WindowCenter.Instance.Open<ItemTipWin>(); |
| | | // } |
| | | // else |
| | | // { |
| | | // WindowCenter.Instance.Open<ItemBoxTipWin>(); |
| | | // } |
| | | // break; |
| | | // case TipType.TreasurePavilion: |
| | | // TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1; |
| | | // TreasurePavilionModel.Instance.showTipFromPiece = config.ID; |
| | | // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>(); |
| | | // break; |
| | | // default: |
| | | // WindowCenter.Instance.Open<ItemTipWin>(); |
| | | // break; |
| | | // } |
| | | mainTipData.getWay.defaultUnfold = item.unfoldGetWay; |
| | | switch (tipType) |
| | | { |
| | | case TipType.Equip: |
| | | // WindowCenter.Instance.Open<EquipTipWin>(); |
| | | break; |
| | | |
| | | // case TipType.PetMount: |
| | | // WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | // break; |
| | | |
| | | case TipType.BoxItem: |
| | | UIManager.Instance.OpenWindow<BoxItemWin>(); |
| | | break; |
| | | case TipType.BoxChooseItem: |
| | | UIManager.Instance.OpenWindow<ChooseItemsWin>(); |
| | | break; |
| | | case TipType.TreasurePavilion: |
| | | // TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1; |
| | | // TreasurePavilionModel.Instance.showTipFromPiece = config.ID; |
| | | // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>(); |
| | | break; |
| | | default: |
| | | UIManager.Instance.OpenWindow<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | public static void Show(string guid, bool operatable = true) |
| | |
| | | // case TipType.PetMount: |
| | | // WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | // break; |
| | | // case TipType.BoxItem: |
| | | // if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>()) |
| | | // { |
| | | // WindowCenter.Instance.Open<ItemTipWin>(); |
| | | // } |
| | | // else |
| | | // { |
| | | // WindowCenter.Instance.Open<ItemBoxTipWin>(); |
| | | // } |
| | | // break; |
| | | case TipType.BoxItem: |
| | | UIManager.Instance.OpenWindow<BoxItemWin>(); |
| | | break; |
| | | case TipType.BoxChooseItem: |
| | | UIManager.Instance.OpenWindow<ChooseItemsWin>(); |
| | | break; |
| | | // case TipType.TreasurePavilion: |
| | | // TreasurePavilionModel.Instance.selectGubao = item.config.EffectValueA1; |
| | | // TreasurePavilionModel.Instance.showTipFromPiece = item.itemId; |
| | |
| | | |
| | | } |
| | | |
| | | public static void ShowGood(int goodId, int itemId) |
| | | { |
| | | secondaryData = null; |
| | | |
| | | var isEquip = ItemLogicUtility.Instance.IsRealmEquip(itemId); |
| | | if (isEquip) |
| | | { |
| | | mainTipData = CreateGoodEquipData(itemId, goodId); |
| | | } |
| | | else |
| | | { |
| | | mainTipData = CreateGoodItemData(itemId, goodId); |
| | | } |
| | | |
| | | BuyItemController.Instance.SetGood(goodId); |
| | | var itemConfig = ItemConfig.Get(itemId); |
| | | if (isEquip) |
| | | { |
| | | // WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | else |
| | | { |
| | | var tipType = GetTipType(itemId); |
| | | |
| | | // switch (tipType) |
| | | // { |
| | | // case TipType.PetMount: |
| | | // WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | // break; |
| | | // case TipType.BoxItem: |
| | | // if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>()) |
| | | // { |
| | | // WindowCenter.Instance.Open<ItemTipWin>(); |
| | | // } |
| | | // else |
| | | // { |
| | | // WindowCenter.Instance.Open<ItemBoxTipWin>(); |
| | | // } |
| | | // break; |
| | | // default: |
| | | // WindowCenter.Instance.Open<ItemTipWin>(); |
| | | // break; |
| | | // } |
| | | } |
| | | } |
| | | |
| | | // public static void ShowCustomEquip(CustomEquipInfo info) |
| | | // { |
| | |
| | | }; |
| | | } |
| | | |
| | | // static TipData CreateItemData(int itemId) |
| | | // { |
| | | // return new TipData() |
| | | // { |
| | | // itemId = itemId, |
| | | // baseInfo = GetBaseInfo(itemId), |
| | | // baseProperty = GetBaseProperty(itemId), |
| | | // exchangeItemId = itemId, |
| | | // spiritWeaponProperty = GetSpiritWeaponProperty(itemId), |
| | | // legendProperty = GetLegendProperty(itemId), |
| | | // petMountBaseProperty = GetPetMountBaseProperty(itemId), |
| | | // getWay = GetGetWay(itemId), |
| | | // shenProperty = GetShenProperty(itemId) |
| | | // }; |
| | | // } |
| | | static TipData CreateItemData(int itemId) |
| | | { |
| | | return new TipData() |
| | | { |
| | | itemId = itemId, |
| | | baseInfo = GetBaseInfo(itemId), |
| | | // baseProperty = GetBaseProperty(itemId), |
| | | exchangeItemId = itemId, |
| | | // spiritWeaponProperty = GetSpiritWeaponProperty(itemId), |
| | | // legendProperty = GetLegendProperty(itemId), |
| | | // petMountBaseProperty = GetPetMountBaseProperty(itemId), |
| | | // getWay = GetGetWay(itemId), |
| | | // shenProperty = GetShenProperty(itemId) |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateGoodItemData(int itemId, int goodId) |
| | | { |
| | |
| | | // return skillInfo; |
| | | // } |
| | | |
| | | // private static WingRefineMaterials GetWingRefineMaterials(string guid) |
| | | // { |
| | | // var item = packModel.GetItemByGuid(guid); |
| | | // if (item == null) |
| | | // { |
| | | // return default(WingRefineMaterials); |
| | | // } |
| | | |
| | | // if (item.config.Type != 113) |
| | | // { |
| | | // return default(WingRefineMaterials); |
| | | // } |
| | | |
| | | // var refineMaterials = new WingRefineMaterials(); |
| | | // refineMaterials.materials = new List<Int2>(); |
| | | |
| | | // var ids = item.GetUseData((int)ItemUseDataKey.wingMaterialItemID); |
| | | // var values = item.GetUseData((int)ItemUseDataKey.wingMaterialItemCount); |
| | | // if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty()) |
| | | // { |
| | | // var min = Mathf.Min(ids.Count, values.Count); |
| | | // for (int i = 0; i < min; i++) |
| | | // { |
| | | // refineMaterials.materials.Add(new Int2(ids[i], values[i])); |
| | | // } |
| | | // } |
| | | |
| | | // return refineMaterials; |
| | | // } |
| | | |
| | | |
| | | // private static GetWay GetGetWay(int itemId) |
| | | // { |
| | |
| | | // return getWay; |
| | | // } |
| | | |
| | | // private static List<ItemOperateType> GetOperates(int itemId, int itemCount = 0) |
| | | // { |
| | | // var config = ItemConfig.Get(itemId); |
| | | // var operates = new List<ItemOperateType>(); |
| | | // var lsItemID = 150; |
| | | // if (config.CanSell == 1 && itemId != lsItemID) |
| | | // { |
| | | // operates.Add(ItemOperateType.sell); |
| | | // } |
| | | |
| | | // // if (itemCount > 1 && itemId != lsItemID) |
| | | // // { |
| | | // // operates.Add(ItemOperateType.split); |
| | | // // } |
| | | |
| | | // if (config.UseTag == 1) |
| | | // { |
| | | // if (itemId != lsItemID) |
| | | // operates.Add(ItemOperateType.makeUse); |
| | | // else |
| | | // operates.Add(ItemOperateType.lsExchange); |
| | | // } |
| | | |
| | | // if (config.Type == 25 || config.Effect1 == 225) |
| | | // { |
| | | // operates.Add(ItemOperateType.inlay); |
| | | // } |
| | | |
| | | // if (!config.JumpComposeCondi.IsNullOrEmpty()) |
| | | // { |
| | | // var jumpId = 0; |
| | | // if (composeModel.CheckComposeItemById(itemId, out jumpId)) |
| | | // { |
| | | // operates.Add(ItemOperateType.compose); |
| | | // } |
| | | // } |
| | | |
| | | // return operates; |
| | | // } |
| | | |
| | | |
| | | // private static List<ItemOperateType> GetOperates(string guid) |
| | | // { |
| | | // var item = packModel.GetItemByGuid(guid); |
| | | // if (item == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | |
| | | // var operates = new List<ItemOperateType>(); |
| | | |
| | | // var packType = item.packType; |
| | | // if (WindowCenter.Instance.IsOpen("DepotWin")) |
| | | // { |
| | | // switch (packType) |
| | | // { |
| | | // case PackType.Warehouse: |
| | | // operates.Add(ItemOperateType.putOut); |
| | | // break; |
| | | // default: |
| | | // operates.Add(ItemOperateType.putIn); |
| | | // break; |
| | | // } |
| | | |
| | | // return operates; |
| | | // } |
| | | |
| | | // if (packType == PackType.Equip) |
| | | // { |
| | | // if (WindowCenter.Instance.IsOpen("RealmEquipWin")) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOff); |
| | | |
| | | // if (FuncOpen.Instance.IsFuncOpen(1)) |
| | | // { |
| | | // operates.Add(ItemOperateType.strength); |
| | | // } |
| | | |
| | | // if (FuncOpen.Instance.IsFuncOpen(172)) |
| | | // { |
| | | // operates.Add(ItemOperateType.star); |
| | | // } |
| | | |
| | | // if (FuncOpen.Instance.IsFuncOpen(2)) |
| | | // { |
| | | // operates.Add(ItemOperateType.inlay); |
| | | // } |
| | | |
| | | // if (FuncOpen.Instance.IsFuncOpen(91)) |
| | | // { |
| | | // int limitLevel = 0; |
| | | // if (equipModel.EquipLevelFuncID != null) |
| | | // limitLevel = equipModel.EquipLevelFuncID[91]; |
| | | // if (item.config.LV >= limitLevel) |
| | | // operates.Add(ItemOperateType.train); |
| | | // } |
| | | |
| | | // if (EquipEvolveModel.Instance.IsShowEvolveBtn(item.itemId)) |
| | | // { |
| | | // operates.Add(ItemOperateType.default1); |
| | | // } |
| | | // return operates; |
| | | // } |
| | | |
| | | // if (ItemLogicUtility.Instance.IsRealmEquip(item.itemId) && WindowCenter.Instance.IsOpen("RoleEquipWin")) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOff); |
| | | // return operates; |
| | | // } |
| | | |
| | | // if (ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId) && WindowCenter.Instance.IsOpen("SpiritEquipBagWin")) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOff); |
| | | // return operates; |
| | | // } |
| | | // } |
| | | |
| | | // if (packType == PackType.Warehouse) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOut); |
| | | // return operates; |
| | | // } |
| | | |
| | | // if (item.isAuction) |
| | | // { |
| | | // operates.Add(ItemOperateType.putAway); |
| | | // } |
| | | |
| | | // var isEquip = ItemLogicUtility.Instance.IsRealmEquip(item.itemId); |
| | | // var isSpiritWeapon = ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId); |
| | | // if (isEquip || isSpiritWeapon) |
| | | // { |
| | | // var isOverdue = ItemLogicUtility.Instance.IsOverdue(guid); |
| | | // if (item.config.CanSell == 1) |
| | | // { |
| | | // operates.Add(ItemOperateType.sell); |
| | | // } |
| | | |
| | | // if (item.config.ExpireTime > 0 && isOverdue && itemOverdueModel.CanRenewal(item.itemId)) |
| | | // { |
| | | // operates.Add(ItemOperateType.renewal); |
| | | // } |
| | | |
| | | // if (!isOverdue) |
| | | // { |
| | | // if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId)) |
| | | // { |
| | | // if (isEquip) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOn); |
| | | |
| | | // if (!item.config.JumpComposeCondi.IsNullOrEmpty()) |
| | | // { |
| | | // var jumpId = 0; |
| | | // if (composeModel.CheckComposeItemById(item.itemId, out jumpId)) |
| | | // { |
| | | // operates.Add(ItemOperateType.compose); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // if (isSpiritWeapon) |
| | | // { |
| | | // if (WindowCenter.Instance.IsOpen<RoleEquipWin>()) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOn); |
| | | // } |
| | | // else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen("SpiritEquipBagWin")) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOn); |
| | | // } |
| | | // } |
| | | // } |
| | | // //else |
| | | // //{ |
| | | // // if (item.config.ItemColor > 3) |
| | | // // { |
| | | // // operates.Add(ItemOperateType.exchange); |
| | | // // } |
| | | // //} |
| | | // } |
| | | |
| | | // return operates; |
| | | // } |
| | | // if (ItemLogicUtility.Instance.IsDogzEquip(item.itemId)) |
| | | // { |
| | | // if (packType == PackType.DogzItem) |
| | | // { |
| | | // if (item.config.ItemColor > 2 && item.config.ItemColor < 6) |
| | | // { |
| | | // operates.Add(ItemOperateType.compose); |
| | | // } |
| | | // operates.Add(ItemOperateType.putOn); |
| | | // } |
| | | // else if (packType == PackType.DogzEquip) |
| | | // { |
| | | // operates.Add(ItemOperateType.putOff); |
| | | // } |
| | | // return operates; |
| | | // } |
| | | |
| | | // operates.AddRange(GetOperates(item.itemId, item.count)); |
| | | |
| | | // return operates; |
| | | // } |
| | | |
| | | |
| | | |
| | | private static List<ItemOperateType> GetGoodOperates(int goodId) |
| | |
| | | |
| | | private static TipType GetTipType(int itemId) |
| | | { |
| | | if (GeneralDefine.chestDisplayItems.Contains(itemId)) |
| | | var boxType = ChestsAwardConfig.GetBoxType(itemId); |
| | | if (boxType == 1) |
| | | { |
| | | return TipType.BoxItem; |
| | | } |
| | | else if (boxType == 2) |
| | | { |
| | | return TipType.PeerlessChest; |
| | | return TipType.BoxChooseItem; |
| | | } |
| | | |
| | | // if (ChestsAwardConfig.IsBox(itemId)) |
| | | // { |
| | | // return TipType.BoxItem; |
| | | // } |
| | | |
| | | var config = ItemConfig.Get(itemId); |
| | | switch (config.Type) |
| | |
| | | case 111: |
| | | case 112: |
| | | return TipType.Equip; |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | return TipType.PetMount; |
| | | // case 26: |
| | | // case 41: |
| | | // case 42: |
| | | // return TipType.PetMount; |
| | | case 147: |
| | | return TipType.TreasurePavilion; |
| | | default: |
| | | return TipType.Item; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [System.Diagnostics.Conditional("UNITY_EDITOR")] |
| | | private static void PrintItemBrief(int itemId) |
| | | { |
| | |
| | | using System.Collections; |
| | | |
| | | |
| | | public struct Item |
| | | public struct Item |
| | | { |
| | | public int id; |
| | | public ulong countEx; |
| | | public int quality; |
| | | public int bind; //绑定 或者 拍卖 交易 |
| | | |
| | | public Item(int _id, ulong _count) |
| | | { |
| | | public int id; |
| | | public int count; //兼容旧代码保留 |
| | | public ulong countEx; //兼容旧代码count,当数量超过了32位无法表示时使用 |
| | | public int quality; |
| | | public int bind; |
| | | this.id = _id; |
| | | this.quality = 0; |
| | | this.bind = 0; |
| | | this.countEx = _count; |
| | | } |
| | | |
| | | |
| | | public Item(int _id, ulong _count) |
| | | { |
| | | this.id = _id; |
| | | this.count = (int)_count; |
| | | this.quality = 0; |
| | | this.bind = 0; |
| | | this.countEx = _count; |
| | | } |
| | | public Item(int _id, ulong _count, int _quality) |
| | | { |
| | | this.id = _id; |
| | | this.quality = _quality; |
| | | this.bind = 0; |
| | | this.countEx = _count; |
| | | } |
| | | |
| | | public Item(int _id, ulong _count, int _quality) |
| | | { |
| | | this.id = _id; |
| | | this.count = (int)_count; |
| | | this.quality = _quality; |
| | | this.bind = 0; |
| | | this.countEx = _count; |
| | | } |
| | | public Item(int _id, ulong _count, int _bind = 0, int _quality = 0) |
| | | { |
| | | this.id = _id; |
| | | this.quality = _quality; |
| | | this.bind = _bind; |
| | | this.countEx = _count; |
| | | } |
| | | |
| | | public Item(int _id, ulong _count, int _bind = 0, int _quality = 0) |
| | | { |
| | | this.id = _id; |
| | | this.count = (int)_count; |
| | | this.quality = _quality; |
| | | this.bind = _bind; |
| | | this.countEx = _count; |
| | | } |
| | | |
| | | #region 旧代码兼容 显示无法超过32位 |
| | | |
| | | public Item(int _id, int _count) |
| | | { |
| | | this.id = _id; |
| | | this.count = _count; |
| | | this.quality = 0; |
| | | this.bind = 0; |
| | | this.countEx = (ulong)_count; |
| | | } |
| | | |
| | | public Item(int _id, int _count, int _quality) |
| | | { |
| | | this.id = _id; |
| | | this.count = _count; |
| | | this.quality = _quality; |
| | | this.bind = 0; |
| | | this.countEx = (ulong)_count; |
| | | } |
| | | |
| | | |
| | | public Item(int _id, int _count, int _bind = 0, int _quality = 0) |
| | | { |
| | | this.id = _id; |
| | | this.count = _count; |
| | | this.quality = _quality; |
| | | this.bind = _bind; |
| | | this.countEx = (ulong)_count; |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | public class CommonGetItemCell : CellView
|
| | | public class CommonGetItemCell : CellView
|
| | | {
|
| | | [SerializeField] List<CommonGetItem> commonGetItems = new List<CommonGetItem>();
|
| | | public void Display(int index, List<Item> showItems)
|
| | | {
|
| | | [SerializeField] List<CommonGetItem> commonGetItems = new List<CommonGetItem>();
|
| | | [SerializeField] HorizontalLayoutGroup horizontalLayout;
|
| | | public void Display(int rowIndex)
|
| | | for (int i = 0; i < commonGetItems.Count; i++)
|
| | | {
|
| | | var dict = ItemLogicUtility.Instance.totalShowItems;
|
| | | var list = dict.Keys.ToList();
|
| | | int rowCount = (int)Mathf.Ceil((float)list.Count / 5);
|
| | | horizontalLayout.childAlignment= rowCount > 1?TextAnchor.MiddleLeft: TextAnchor.MiddleCenter;
|
| | |
|
| | | for (int i = 0; i < commonGetItems.Count; i++)
|
| | | if (index + i < showItems.Count)
|
| | | {
|
| | | int index = rowIndex * 5 + i;
|
| | | if (index < list.Count)
|
| | | {
|
| | | int itemId = list[index];
|
| | | commonGetItems[i].Display(itemId);
|
| | | commonGetItems[i].SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | commonGetItems[i].SetActive(false);
|
| | | }
|
| | | int itemId = showItems[index + i].id;
|
| | | commonGetItems[i].Display(itemId);
|
| | | commonGetItems[i].SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | commonGetItems[i].SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | using System.Linq;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | //用于显示获得物品的窗口
|
| | | public class CommonGetItemWin : UIBase
|
| | | //用于显示获得物品的窗口
|
| | | public class CommonGetItemWin : UIBase
|
| | | {
|
| | | [SerializeField] ScrollerController scroller;
|
| | |
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | [SerializeField] ScrollerController scroller;
|
| | | [SerializeField] RichText desc;
|
| | | [SerializeField] Button sureBtn;
|
| | | [SerializeField] Text sureText;
|
| | | [SerializeField] TextEx closeText;
|
| | | ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent;
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | CreateScroller();
|
| | | }
|
| | |
|
| | |
|
| | | float openTime;
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | ItemLogicUtility.Instance.OnGetItemShowEvent -= OnGetItemShowEvent;
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | ItemLogicUtility.Instance.ClearGetItem();
|
| | |
|
| | | protected override void InitComponent()
|
| | | }
|
| | |
|
| | | List<Item> showItems = new List<Item>();
|
| | | void CreateScroller()
|
| | | {
|
| | | scroller.Refresh();
|
| | | showItems = ItemLogicUtility.Instance.totalShowItems.Values.ToList();
|
| | | showItems.Sort(SortItem);
|
| | | for (int i = 0; i < showItems.Count; i++)
|
| | | {
|
| | | base.InitComponent();
|
| | | Debug.Log("初始化通用获得物品窗口");
|
| | | sureBtn.SetListener(() => UIManager.Instance.CloseWindow<CommonGetItemWin>());
|
| | | }
|
| | |
|
| | | public override void Refresh()
|
| | | {
|
| | | base.Refresh();
|
| | | Debug.Log("刷新通用获得物品窗口");
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Refresh();
|
| | | ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent;
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | desc.SetActive(!string.IsNullOrEmpty(ItemLogicUtility.Instance.getItemInfo));
|
| | | desc.text = ItemLogicUtility.Instance.getItemInfo;
|
| | | sureText.text = ItemLogicUtility.Instance.getItemBtnText;
|
| | | CreateScroller();
|
| | | closeText.text = Language.Get("L2004");
|
| | | openTime = Time.time;
|
| | | }
|
| | |
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | ItemLogicUtility.Instance.OnGetItemShowEvent -= OnGetItemShowEvent;
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | ItemLogicUtility.Instance.OnGetItem?.Invoke();
|
| | | ItemLogicUtility.Instance.ClearGetItem();
|
| | |
|
| | | }
|
| | |
|
| | | void CreateScroller()
|
| | | {
|
| | | scroller.Refresh();
|
| | | var keys = ItemLogicUtility.Instance.totalShowItems.Keys.ToList();
|
| | | int rowCount = (int)Mathf.Ceil((float)keys.Count / 5);
|
| | | for (int i = 0; i < rowCount; i++)
|
| | | {
|
| | | if (i % 5 == 0)
|
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | scroller.Restart();
|
| | | }
|
| | |
|
| | | float needRefreshTime; //避免封包过多卡顿
|
| | | void OnGetItemShowEvent()
|
| | | {
|
| | | needRefreshTime = Time.time + 0.3f;
|
| | |
|
| | | }
|
| | |
|
| | | void RefreshScroller()
|
| | | {
|
| | | if (needRefreshTime <= 0)
|
| | | return;
|
| | |
|
| | | if (Time.time < needRefreshTime)
|
| | | return;
|
| | |
|
| | | if (scroller.GetNumberOfCells(scroller.m_Scorller) != ItemLogicUtility.Instance.totalShowItems.Count)
|
| | | {
|
| | | CreateScroller();
|
| | | }
|
| | | else
|
| | | {
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | | needRefreshTime = 0;
|
| | | }
|
| | |
|
| | | protected void LateUpdate()
|
| | | {
|
| | | RefreshScroller();
|
| | | if (ItemLogicUtility.Instance.closeSeconds == 0)
|
| | | return;
|
| | |
|
| | | float closeTime = ItemLogicUtility.Instance.closeSeconds - (Time.time - openTime);
|
| | | if (closeTime <= 0)
|
| | | {
|
| | | UIManager.Instance.CloseWindow<CommonGetItemWin>();
|
| | | return;
|
| | | }
|
| | | closeText.text = Language.Get("AutoCloseAfterSeconds", (int)closeTime);
|
| | | }
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as CommonGetItemCell;
|
| | | _cell?.Display(cell.index);
|
| | | }
|
| | | scroller.Restart();
|
| | | }
|
| | |
|
| | | int SortItem(Item itemA, Item itemB)
|
| | | { |
| | | var itemConfigA = ItemConfig.Get(itemA.id);
|
| | | var itemConfigB = ItemConfig.Get(itemB.id);
|
| | | return itemConfigB.ItemColor - itemConfigA.ItemColor;
|
| | | }
|
| | |
|
| | | float needRefreshTime; //避免封包过多卡顿
|
| | | void OnGetItemShowEvent()
|
| | | {
|
| | | needRefreshTime = Time.time + 0.3f;
|
| | |
|
| | | }
|
| | |
|
| | | void RefreshScroller()
|
| | | {
|
| | | if (needRefreshTime <= 0)
|
| | | return;
|
| | |
|
| | | if (Time.time < needRefreshTime)
|
| | | return;
|
| | |
|
| | | if (scroller.GetNumberOfCells(scroller.m_Scorller) != ItemLogicUtility.Instance.totalShowItems.Count)
|
| | | {
|
| | | CreateScroller();
|
| | | }
|
| | | else
|
| | | {
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | | needRefreshTime = 0;
|
| | | }
|
| | |
|
| | | protected void LateUpdate()
|
| | | {
|
| | | RefreshScroller();
|
| | | }
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as CommonGetItemCell;
|
| | | _cell?.Display(cell.index, showItems);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | |
|
| | | // 通用显示获得的物品
|
| | | public void ShowGetItem(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default")
|
| | | public void ShowGetItem(List<Item> items, string eventName = "default", bool isNameShow = true)
|
| | | {
|
| | | if (getItemEventName != eventName)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | getItemInfo = info;
|
| | | OnGetItem = func;
|
| | | if (btnName == "")
|
| | | btnName = Language.Get("PopConfirmWin_OK");
|
| | | getItemBtnText = btnName;
|
| | | closeSeconds = seconds;
|
| | | this.isNameShow = isNameShow;
|
| | | OnGetItemShowEvent?.Invoke();
|
| | | if (!UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
|
| | |
| | | getItemEventName = "";
|
| | | }
|
| | |
|
| | | |
| | | public void UseItem(string guid, int useCnt = 1, int extra = 0)
|
| | | {
|
| | | var item = packModel.GetItemByGuid(guid);
|
| | | if (item == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var error = 0;
|
| | | if (CanUseItem(guid, useCnt, out error))
|
| | | {
|
| | | UseItemSendServer(guid, useCnt, extra);
|
| | | }
|
| | | else
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | case 1:
|
| | | SysNotifyMgr.Instance.ShowTip("EverydayUseLimit");
|
| | | break;
|
| | | case 2:
|
| | | SysNotifyMgr.Instance.ShowTip("UseCntLimit");
|
| | | break;
|
| | | case 3:
|
| | | SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_749572");
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CanUseItem(string guid, int useCnt, out int error)
|
| | | {
|
| | | var item = packModel.GetItemByGuid(guid);
|
| | | if (item == null)
|
| | | {
|
| | | error = 999;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | if (item.config.Type == 145 && item.config.CDTime > 0)
|
| | | {
|
| | | var createTime = item.GetUseDataFirstValue((int)ItemUseDataKey.createTime);
|
| | | if (createTime > 0)
|
| | | {
|
| | | DateTime useTime;
|
| | | if (item.config.CDTypeEx == 1)
|
| | | {
|
| | | //itemConfig.CDTime 为天,过0点可用
|
| | | useTime = TimeUtility.GetTime((uint)createTime).AddDays(item.config.CDTime);
|
| | | useTime = TimeUtility.GetDayStartTime(useTime.Year, useTime.Month, useTime.Day);
|
| | | }
|
| | | else
|
| | | {
|
| | | useTime = TimeUtility.GetTime((uint)createTime).AddSeconds(item.config.CDTime);
|
| | | }
|
| | | if (TimeUtility.ServerNow < useTime)
|
| | | {
|
| | | error = 3;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | var usedCountToday = packModel.GetItemUsedTimesToday(item.itemId);
|
| | | if (item.config.MaxSkillCnt > 0 && item.config.MaxSkillCnt <= usedCountToday)
|
| | | {
|
| | | error = 1;
|
| | | return false;
|
| | | }
|
| | |
|
| | | //var usedCountTotal = packModel.GetItemTotalUsedTimes(item.itemId);
|
| | | // var fruitConfig = AttrFruitConfig.Get(item.itemId);
|
| | | // if (fruitConfig != null)
|
| | | // {
|
| | | // var limitTimes = 0;
|
| | | // if (fruitConfig.FuncID == 2)
|
| | | // {
|
| | | // limitTimes = alchemyModel.GetAlchemyDrugUseLimit(item.itemId);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // limitTimes = fruitConfig.basicUseLimit;
|
| | | // }
|
| | | // if (usedCountTotal >= limitTimes || useCnt > limitTimes)
|
| | | // {
|
| | | // error = 1;
|
| | | // return false;
|
| | | // }
|
| | | // }
|
| | |
|
| | | error = 0;
|
| | | return true;
|
| | | }
|
| | |
|
| | | void UseItemSendServer(string guid, int useCnt, int extra)
|
| | | {
|
| | | var itemModel = packModel.GetItemByGuid(guid);
|
| | | if (itemModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var useItem = new CA323_tagCMUseItems();
|
| | | useItem.ItemIndex = (byte)itemModel.gridIndex;
|
| | | useItem.UseCnt = (ushort)useCnt;
|
| | | useItem.ExData = (uint)extra;
|
| | | GameNetSystem.Instance.SendInfo(useItem); //使用物品
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | var guid = PackManager.Instance.GetSinglePack(PackType.Item).itemGuidList[index];
|
| | | if (string.IsNullOrEmpty(guid))
|
| | | return;
|
| | | itemCell.Init(PackManager.Instance.GetItemByGuid(guid));
|
| | |
|
| | | var item = PackManager.Instance.GetItemByGuid(guid);
|
| | | ulong count = 0;
|
| | | if (GeneralDefine.itemMoneyCountDict.ContainsKey(item.itemId))
|
| | | {
|
| | | //展示货币数量的物品
|
| | | count = UIHelper.GetMoneyCnt(GeneralDefine.itemMoneyCountDict[item.itemId]);
|
| | | }
|
| | | else
|
| | | {
|
| | | count = (ulong)item.count;
|
| | | }
|
| | | itemCell.Init(new ItemCellModel(item.itemId, false, count));
|
| | | itemCell.button.AddListener(()=>
|
| | | {
|
| | | ItemTipUtility.Show(guid);
|
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
| | | itemIcon.SetOrgSprite(config.IconKey);
|
| | | ItemConfig itemConfig = ItemConfig.Get(itemId);
|
| | | bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic));
|
| | | if (packModel.textCountShow.ContainsKey(itemId))
|
| | | {
|
| | | countText.SetActive(true);
|
| | | countText.text = count > 1 ? packModel.textCountShow[itemId] + "x" + count : packModel.textCountShow[itemId];
|
| | | }
|
| | | else if (packModel.gameCashShow.Contains(itemId))
|
| | | if (packModel.gameCashShow.Contains(itemId))
|
| | | {
|
| | | //代金券
|
| | | countText.SetActive(true);
|
| | | countText.text = count > 1000000 ? UIHelper.ReplaceLargeNum(count / 100.0f) : (count / 100.0f).ToString("0.#");
|
| | | }
|
| | | else if (Array.IndexOf(packModel.textCountShow2, itemId) != -1)
|
| | | {
|
| | | countText.SetActive(true);
|
| | | countText.text = UIHelper.ReplaceLargeNum(count * (ulong)config.EffectValueA1);
|
| | | }
|
| | | else
|
| | | {
|
| | | countText.SetActive(count > 1);
|
| | | if (count > 1)
|
| | | countText.SetActive(count > 0);
|
| | | if (count > 0)
|
| | | {
|
| | | countText.text = UIHelper.ReplaceLargeNum((double)count);
|
| | | }
|
| | |
| | | |
| | | public class PackManager : GameSystemManager<PackManager> |
| | | { |
| | | public event Action<PackType> refrechPackEvent; //刷新整个背包数据 |
| | | |
| | | //物品(创建)刷新,可能批量创建注意效率; bool:true代表创建 false 刷新; 注意0707物品数量刷新不包含在此事件 |
| | | public event Action<PackType, string, bool> ChangeItemEvent; // 背包类型,GUID,是否创建 |
| | | |
| | | //删除物品,可能批量删除注意效率 |
| | | public event Action<PackType, string> DeleteItemEvent; // 背包类型,GUID |
| | | |
| | | // 单物品刷新 在得到新物品、物品数量的改变,清理该物品时均会触发 ; 但0725整个背包刷新不触发,如果有需要单独数量刷新事件另外处理 |
| | | // 触发比较频繁,界面使用时可以做个汇总后延迟刷新 |
| | | public event Action<PackType, int, int> RefreshItemEvent; //背包类型,位置索引,物品id |
| | | public event Action<PackType> gridRefreshEvent; //背包可用格子数刷新 |
| | | public event Action<int, int> useItemSuccessEvent; //物品使用成功 int 位置索引 int物品id |
| | | |
| | | public event Action<int> refreshItemDayUseCountEvent; //刷新物品每日使用数量 |
| | | public event Action<int> refreshItemSumUseCountEvent; //刷新物品总使用数量 |
| | | |
| | | public bool isPlayBetterEquipEffect { get; set; } //整理背包时是否播放特效 |
| | | |
| | | |
| | | private Dictionary<PackType, SinglePack> playerPackDict = new Dictionary<PackType, SinglePack>(); |
| | | private Dictionary<string, ItemModel> itemGUIDDict = new Dictionary<string, ItemModel>(); |
| | | |
| | | private Dictionary<int, int> PackGirdServerBuyCountDict = new Dictionary<int, int>(); //背包类型:购买格子的次数 |
| | | |
| | | //读表数据 |
| | | public Dictionary<int, int> PackMaxCountDict = new Dictionary<int, int>(); //背包类型:背包格子最大数量 |
| | | public Dictionary<int, int> PackInitCountDict = new Dictionary<int, int>(); //背包类型:初始数量 |
| | | public int initBagGridCount { get; private set; } //初始物品背包格子数 |
| | | public int[] itemPackSortTyps { get; private set; } //背包物品的按类型排序 |
| | | public List<string> composeItemGuidList = new List<string>(); //合成列表物品guid |
| | | |
| | | //开格子 |
| | | public Dictionary<int, int> openGirdMoneyDict = new Dictionary<int, int>(); //背包类型:消耗货币类型 |
| | | public Dictionary<int, int[]> openGirdMoneyValueDict = new Dictionary<int, int[]>(); //背包类型:消耗货币值(按次数定价) |
| | | public Dictionary<int, int[]> openGirdCountDict = new Dictionary<int, int[]>(); //背包类型:每次开的格子数量 |
| | | public static string StrengthAttrShift_RecordKey = ""; |
| | | public const string RecordKnapsackTitle = "RecordKnapsackTitle"; |
| | | |
| | |
| | | Dictionary<int, List<int>> sharedUseCountItemDict { get; set; } |
| | | bool isUpdatePlayerLv = false; |
| | | |
| | | //AlchemyModel alchemyModel { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } |
| | | //ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | |
| | | List<string> commonShowAwardEvents = new List<string>(); |
| | | |
| | | public int[] gameCashShow; //代金券特殊显示 除以100 |
| | | public int[] autoUseItemIDs; |
| | | public override void Init() |
| | | { |
| | |
| | | // } |
| | | // } |
| | | |
| | | ParseItemCount(); |
| | | |
| | | autoUseItemIDs = JsonMapper.ToObject<int[]>(FuncConfigConfig.Get("ItemTipsNum").Numerical2); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | // SysNotifyMgr.Instance.sysNotifyEvent -= RefreshSysInfo; |
| | | } |
| | | |
| | | public Dictionary<int, string> textCountShow = new Dictionary<int, string>(); |
| | | public int[] textCountShow2; |
| | | public List<int> gameCashShow = new List<int>(); |
| | | |
| | | public void ParseItemCount() |
| | | { |
| | | var textConfig = FuncConfigConfig.Get("ItemCountShow"); |
| | | var json = JsonMapper.ToObject(textConfig.Numerical1); |
| | | foreach (var key in json.Keys) |
| | | { |
| | | var itemID = int.Parse(key); |
| | | textCountShow[itemID] = json[key].ToString(); |
| | | } |
| | | |
| | | textCountShow2 = JsonMapper.ToObject<int[]>(textConfig.Numerical2); |
| | | gameCashShow = JsonMapper.ToObject<List<int>>(textConfig.Numerical3); |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnFuncStateChangeEvent(int id) |
| | |
| | | // } |
| | | } |
| | | |
| | | public event Action<PackType> refrechPackEvent; //刷新整个背包数据 |
| | | |
| | | //物品(创建)刷新,可能批量创建注意效率; bool:true代表创建 false 刷新; 注意0707物品数量刷新不包含在此事件 |
| | | public event Action<PackType, string, bool> ChangeItemEvent; // 背包类型,GUID,是否创建 |
| | | |
| | | //删除物品,可能批量删除注意效率 |
| | | public event Action<PackType, string> DeleteItemEvent; // 背包类型,GUID |
| | | |
| | | // 单物品刷新 在得到新物品、物品数量的改变,清理该物品时均会触发 ; 但0725整个背包刷新不触发,如果有需要单独数量刷新事件另外处理 |
| | | // 触发比较频繁,界面使用时可以做个汇总后延迟刷新 |
| | | public event Action<PackType, int, int> RefreshItemEvent; //背包类型,位置索引,物品id |
| | | public event Action<PackType> gridRefreshEvent; //背包可用格子数刷新 |
| | | public event Action<int, int> useItemSuccessEvent; //物品使用成功 int 位置索引 int物品id |
| | | |
| | | public event Action<int> refreshItemDayUseCountEvent; //刷新物品每日使用数量 |
| | | public event Action<int> refreshItemSumUseCountEvent; //刷新物品总使用数量 |
| | | |
| | | public bool isPlayBetterEquipEffect { get; set; } //整理背包时是否播放特效 |
| | | |
| | | #region 接收服务端数据 |
| | | private Dictionary<PackType, SinglePack> playerPackDict = new Dictionary<PackType, SinglePack>(); |
| | | private Dictionary<string, ItemModel> itemGUIDDict = new Dictionary<string, ItemModel>(); |
| | | |
| | | |
| | | public void UpdatePack(H0725_tagRolePackRefreshEx packInfo) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | public void UpdateBuyPackGirdCount(HA207_tagSCPackBuyInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.BuyInfoList.Length; i++) |
| | | { |
| | | PackGirdServerBuyCountDict[netPack.BuyInfoList[i].PackType] = netPack.BuyInfoList[i].BuyCnt; |
| | | } |
| | | } |
| | | |
| | | public int[] BuyPackGirdNeedData(PackType packType) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | public void UpdateUnlockedGridCount(H0724_tagRolePackCanUseCount useCount) |
| | | { |
| | |
| | | // } |
| | | // } |
| | | |
| | | #endregion |
| | | |
| | | #region 玩家装备特殊逻辑 |
| | | void ParseConfig() |
| | | { |
| | | var config = FuncConfigConfig.Get("CommonShowAwards"); |
| | | commonShowAwardEvents = JsonMapper.ToObject<List<string>>(config.Numerical1); |
| | | |
| | | config= FuncConfigConfig.Get("InitBagCellCount"); |
| | | ParsePackConfigIni(); |
| | | autoUseItemIDs = JsonMapper.ToObject<int[]>(FuncConfigConfig.Get("AutoUseItem").Numerical1); |
| | | var config= FuncConfigConfig.Get("InitBagCellCount"); |
| | | initBagGridCount = int.Parse(config.Numerical1); |
| | | PackInitCountDict = ConfigParse.ParseIntDict(config.Numerical2); |
| | | |
| | | config = FuncConfigConfig.Get("PackageSortPriority"); |
| | | itemPackSortTyps = ConfigParse.GetMultipleStr<int>(config.Numerical1); |
| | | ParsePackConfigIni(); |
| | | |
| | | config = FuncConfigConfig.Get("OpenPack"); |
| | | openGirdMoneyDict = ConfigParse.ParseIntDict(config.Numerical1); |
| | | openGirdMoneyValueDict = ConfigParse.ParseIntArrayDict(config.Numerical2); |
| | | openGirdCountDict = ConfigParse.ParseIntArrayDict(config.Numerical3); |
| | | |
| | | config = FuncConfigConfig.Get("ItemCountShow"); |
| | | gameCashShow = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | } |
| | | |
| | | void ParsePackConfigIni() |
| | |
| | | } |
| | | |
| | | return File.ReadAllLines(path); |
| | | } |
| | | |
| | | public int GetCanBuyPackGirdCount(PackType type) |
| | | { |
| | | if (!PackMaxCountDict.ContainsKey((int)type)) |
| | | { |
| | | return 0; |
| | | } |
| | | return PackMaxCountDict[(int)type] - GetSinglePack(type).unlockedGridCount; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | int useCnt = 0; |
| | | List<int> shareIdlist = null; |
| | | bool isShare = TryGetShareNumItem(itemId, out shareIdlist); |
| | | if (isShare) |
| | | { |
| | | foreach (var id in shareIdlist) |
| | | { |
| | | int singleUseCnt = 0; |
| | | itemDayUseCntDict.TryGetValue(id, out singleUseCnt); |
| | | useCnt += singleUseCnt; |
| | | } |
| | | } |
| | | else |
| | | // bool isShare = TryGetShareNumItem(itemId, out shareIdlist); |
| | | // if (isShare) |
| | | // { |
| | | // foreach (var id in shareIdlist) |
| | | // { |
| | | // int singleUseCnt = 0; |
| | | // itemDayUseCntDict.TryGetValue(id, out singleUseCnt); |
| | | // useCnt += singleUseCnt; |
| | | // } |
| | | // } |
| | | // else |
| | | { |
| | | itemDayUseCntDict.TryGetValue(itemId, out useCnt); |
| | | } |
| | |
| | | const int ITEMPACK_REDKEY = 102011003; |
| | | Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_BagFuncKey, ITEMPACK_REDKEY); |
| | | |
| | | const int LS_REDKEY = 102011015; |
| | | Redpoint redpointLS = new Redpoint(MainRedDot.RedPoint_BagFuncKey, LS_REDKEY); |
| | | |
| | | |
| | | private void UpdatePackRedpoint(PackType type) |
| | | { |
| | |
| | | } |
| | | |
| | | break; |
| | | case PackType.Warehouse: |
| | | if (singlePack.GetEmptyGridCount() <= 0) |
| | | { |
| | | MainRedDot.Instance.redPointDepotFunc.state = RedPointState.Full; |
| | | } |
| | | else |
| | | { |
| | | MainRedDot.Instance.redPointDepotFunc.state = RedPointState.None; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region 判断物品是否达到使用上限 |
| | | // public bool IsReachUseLimit(string guid, out ulong count) |
| | | // { |
| | | // count = 0; |
| | | // ItemModel itemModel = GetItemByGuid(guid); |
| | | // if (itemModel == null) return false; |
| | | public bool IsReachUseLimit(string guid, out ulong count) |
| | | { |
| | | count = 0; |
| | | ItemModel itemModel = GetItemByGuid(guid); |
| | | if (itemModel == null) return false; |
| | | |
| | | // AttrFruitConfig fruitConfig = AttrFruitConfig.Get(itemModel.itemId); |
| | | // int haveUseCnt = GetItemUsedTimesToday(itemModel.itemId); |
| | | // int sumHaveUseCnt = GetItemTotalUsedTimes(itemModel.itemId); |
| | | // count = (ulong)itemModel.count; |
| | | // bool isReach = false; |
| | | // int remainDayCnt = 0; |
| | | // if (itemModel.config.MaxSkillCnt > 0) |
| | | // { |
| | | // remainDayCnt = itemModel.config.MaxSkillCnt - haveUseCnt; |
| | | // if (itemModel.count > remainDayCnt) |
| | | // { |
| | | // count = (ulong)remainDayCnt; |
| | | // } |
| | | // } |
| | | // AttrFruitConfig fruitConfig = AttrFruitConfig.Get(itemModel.itemId); |
| | | int haveUseCnt = GetItemUsedTimesToday(itemModel.itemId); |
| | | int sumHaveUseCnt = GetItemTotalUsedTimes(itemModel.itemId); |
| | | count = (ulong)itemModel.count; |
| | | bool isReach = false; |
| | | int remainDayCnt = 0; |
| | | if (itemModel.config.MaxSkillCnt > 0) |
| | | { |
| | | remainDayCnt = itemModel.config.MaxSkillCnt - haveUseCnt; |
| | | if (itemModel.count > remainDayCnt) |
| | | { |
| | | count = (ulong)remainDayCnt; |
| | | } |
| | | } |
| | | |
| | | // int remainSumCnt = 0; |
| | | // if (fruitConfig != null) |
| | | // { |
| | | // remainSumCnt = fruitConfig.basicUseLimit - sumHaveUseCnt; |
| | | // if (remainSumCnt <= remainDayCnt && itemModel.count > remainSumCnt) |
| | | // { |
| | | // count = (ulong)remainSumCnt; |
| | | // } |
| | | // } |
| | | int remainSumCnt = 0; |
| | | // if (fruitConfig != null) |
| | | // { |
| | | // remainSumCnt = fruitConfig.basicUseLimit - sumHaveUseCnt; |
| | | // if (remainSumCnt <= remainDayCnt && itemModel.count > remainSumCnt) |
| | | // { |
| | | // count = (ulong)remainSumCnt; |
| | | // } |
| | | // } |
| | | |
| | | // if (count < (ulong)itemModel.count) |
| | | // { |
| | | // isReach = true; |
| | | // } |
| | | if (count < (ulong)itemModel.count) |
| | | { |
| | | isReach = true; |
| | | } |
| | | |
| | | // return isReach; |
| | | // } |
| | | return isReach; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void ReceiveAwardNotify(HA801_tagMCGiveAwardInfo netPack) |
| | | { |
| | | var eventName = UIHelper.ServerStringTrim(netPack.EventName); |
| | | if (eventName == "BuyItem") |
| | | return; |
| | | |
| | | // 仙盟攻城战 |
| | | // if (eventName == "FamilyGCZSQGrid" || eventName == "FamilyGCZSQPass" || eventName == "FamilyGCZSQPassAll" || |
| | | // eventName == "FamilyGCZContiribution" || eventName == "FamilyGCZAtk") |
| | | // { |
| | | // ModelCenter.Instance.GetModel<FairySiegeActModel>()?.OnUpdateAwardInfoAction(netPack); |
| | | // return; |
| | | // } |
| | | if (!commonShowAwardEvents.Contains(eventName)) |
| | | return; |
| | | |
| | | List<Item> showItems = new List<Item>(); |
| | | |
| | | if (netPack.Exp != 0 || netPack.ExpPoint != 0) |
| | | { |
| | | ulong expValue = netPack.Exp + netPack.ExpPoint * (ulong)Constants.ExpPointValue; |
| | | showItems.Add(new Item(GeneralDefine.expDisplayId, expValue)); |
| | | } |
| | | if (netPack.MoneyList.Length != 0) |
| | | { |
| | | for (int i = 0; i < netPack.MoneyLen; i++) |
| | | { |
| | | var moneyType = netPack.MoneyList[i].MoneyType; |
| | | if (GeneralDefine.moneyDisplayIds.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0) |
| | | { |
| | | showItems.Add(new Item(GeneralDefine.moneyDisplayIds[moneyType], netPack.MoneyList[i].MoneyValue)); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (netPack.ItemList.Length != 0) |
| | | { |
| | | for (int i = 0; i < netPack.ItemLen; i++) |
| | | { |
| | | showItems.Add(new Item((int)netPack.ItemList[i].ItemID, netPack.ItemList[i].Count, netPack.ItemList[i].IsBind)); |
| | | } |
| | | } |
| | | |
| | | |
| | | string info = string.Empty; |
| | | if (LanguageConfig.HasKey("commonShowAwardEvents_" + eventName)) |
| | | info = Language.Get("commonShowAwardEvents_" + eventName); |
| | | |
| | | if (showItems.Count == 0) |
| | | return; |
| | | |
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, info, 0, eventName: eventName); |
| | | } |
| | | } |
| | |
| | | public struct ServerDataCouple |
| | | { |
| | | public ServerData serverData1; |
| | | //public ServerData serverData2; |
| | | |
| | | public ServerDataCouple(ServerData _data1) |
| | | { |
| | | serverData1 = _data1; |
| | | //serverData2 = default(ServerData); |
| | | } |
| | | |
| | | public ServerDataCouple(ServerData _data1, ServerData _data2) |
| | | { |
| | | serverData1 = _data1; |
| | | //serverData2 = _data2; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | serverDataList.Sort(ServerData.Compare); |
| | | var max = serverDataList.Count; |
| | | for (int i = 0; i < max; i++, i++) |
| | | for (int i = 0; i < max; i++) |
| | | { |
| | | if (i + 1 < max) |
| | | { |
| | | groupDatas.Add(new ServerDataCouple(serverDataList[i], serverDataList[i + 1])); |
| | | } |
| | | else |
| | | { |
| | | groupDatas.Add(new ServerDataCouple(serverDataList[i])); |
| | | } |
| | | groupDatas.Add(new ServerDataCouple(serverDataList[i])); |
| | | } |
| | | |
| | | m_ServerScroll.Init(groupDatas); |
| | |
| | | List<Item> itemList = new List<Item>();
|
| | | for (int j = 0; j < giftInfoDict[giftInfokeyList[i]].Count; j++)
|
| | | {
|
| | | Item item = new Item(giftInfoDict[giftInfokeyList[i]][j][0], giftInfoDict[giftInfokeyList[i]][j][1]);
|
| | | Item item = new Item(giftInfoDict[giftInfokeyList[i]][j][0], (ulong)giftInfoDict[giftInfokeyList[i]][j][1]);
|
| | | itemList.Add(item);
|
| | | }
|
| | | itemAllList.Add(itemList);
|
| | |
| | | m_RechargeGainItemDict.Add(configs[i].CTGID, _itemList);
|
| | | for (int k = 0; k < _itemArray.Length; k++)
|
| | | {
|
| | | Item _item = new Item(_itemArray[k][0], _itemArray[k][1]);
|
| | | Item _item = new Item(_itemArray[k][0], (ulong)_itemArray[k][1]);
|
| | | _itemList.Add(_item);
|
| | | }
|
| | | }
|
| | |
| | | for (int i = 0; i < _itemJson[jobstr].Count; i++)
|
| | | {
|
| | | m_FirstChargeItemDict[day][job].Add(new Item(int.Parse(_itemJson[jobstr][i][0].ToString()),
|
| | | int.Parse(_itemJson[jobstr][i][1].ToString())));
|
| | | ulong.Parse(_itemJson[jobstr][i][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var _itemCommon = JsonMapper.ToObject<int[][]>(config.CommItemList);
|
| | | for (int i = 0; i < _itemCommon.Length; i++)
|
| | | {
|
| | | m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], _itemCommon[i][1]));
|
| | | m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], (ulong)_itemCommon[i][1]));
|
| | | }
|
| | |
|
| | |
|
| | |
| | | #region 背包红点
|
| | | public const int RedPoint_MainPackKey = 102;
|
| | | public const int RedPoint_BagFuncKey = 10201;
|
| | | public const int RedPoint_DepotFuncKey = 10204;
|
| | | public Redpoint redPointMainPack = new Redpoint(RedPoint_MainPackKey);
|
| | | public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey);
|
| | | public Redpoint redPointDepotFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_DepotFuncKey);
|
| | | #endregion
|
| | |
|
| | |
|
| | |
| | | public void OnClickShopCell(StoreConfig shopInfo)
|
| | | {
|
| | | int itemId = GetReplaceId(shopInfo.ID, shopInfo.ItemID);
|
| | | ItemTipUtility.ShowGood(shopInfo.ID, itemId);
|
| | | ItemTipUtility.Show(itemId);
|
| | | }
|
| | |
|
| | | public int BuyCnt { get; private set; }
|
| | |
| | | |
| | | // HPEx * 1亿 + HP |
| | | |
| | | curHp = (long)fightObj.HPEx * GeneralDefine.HundredMillion + (long)fightObj.HP; |
| | | maxHp = (long)fightObj.MaxHPEx * GeneralDefine.HundredMillion + (long)fightObj.MaxHP; |
| | | curHp = (long)fightObj.HPEx * (long)Constants.ExpPointValue + (long)fightObj.HP; |
| | | maxHp = (long)fightObj.MaxHPEx * (long)Constants.ExpPointValue + (long)fightObj.MaxHP; |
| | | rage = (int)fightObj.AngreXP; |
| | | |
| | | positionNum = fightObj.PosNum - 1; |
| | |
| | | public void Display(int index)
|
| | | {
|
| | | int itemID = ConfirmCancel.getItems[index].id;
|
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)ConfirmCancel.getItems[index].count));
|
| | | itemCell.Init(new ItemCellModel(itemID, false, (ulong)ConfirmCancel.getItems[index].countEx));
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | |
| | | |
| | | public static Material GetDefaultSpriteGrayMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Materials", "SpriteGray"); |
| | | return ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "SpriteGray"); |
| | | } |
| | | |
| | | public static Material GetInstantiatedSpriteGrayMaterial() |
| | |
| | | |
| | | public static Material GetSmoothMaskGrayMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Materials", "SmoothMaskGray"); |
| | | return ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "SmoothMaskGray"); |
| | | } |
| | | |
| | | public static Material GetInstantiatedSpriteTwinkleMaterial() |
| | | { |
| | | var material = ResManager.Instance.LoadAsset<Material>("Materials", "Flash"); |
| | | var material = ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "Flash"); |
| | | return new Material(material); |
| | | } |
| | | |
| | |
| | | |
| | | public static Material GetGUIRenderTextureMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Materials", "UI_RenderTexture"); |
| | | return ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "UI_RenderTexture"); |
| | | } |
| | | |
| | | public static void SetRenderSortingOrder(this GameObject root, int sortingOrder, bool includeChildren) |