6242 子 【开发】【2.0】法宝界面调整 / 【前端】【2.0】法宝调整
5 文件已复制
2个文件已删除
2 文件已重命名
7个文件已添加
27个文件已修改
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: Thursday, February 14, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Threading;
|
| | | using System;
|
| | | using UnityEngine;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public partial class TreasureConfig
|
| | | {
|
| | |
|
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Wednesday, February 20, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class TreasureConfig |
| | | { |
| | | |
| | | public readonly int ID;
|
| | | public readonly int Category;
|
| | | public readonly int PreTreasure;
|
| | |
| | | public readonly int MapId;
|
| | | public readonly int LineId;
|
| | | public readonly int ChallengeLevel;
|
| | | public readonly int[] Potentials;
|
| | | public readonly int[] SkillPower;
|
| | | public readonly string NeedItem;
|
| | | public readonly int EffectID;
|
| | | public readonly string[] Verse;
|
| | | public readonly int ShowNetGotEffect;
|
| | | public readonly int PreferredStage;
|
| | | public readonly int UIScale;
|
| | |
|
| | | public TreasureConfig()
|
| | | {
|
| | | }
|
| | |
|
| | | public TreasureConfig(string input)
|
| | | {
|
| | | try
|
| | | {
|
| | | var tables = input.Split('\t');
|
| | |
|
| | | public readonly int UIScale; |
| | | |
| | | public TreasureConfig() |
| | | { |
| | | } |
| | | |
| | | public TreasureConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out ID);
|
| | |
|
| | | int.TryParse(tables[1],out Category);
|
| | |
| | |
|
| | | int.TryParse(tables[16],out ChallengeLevel);
|
| | |
|
| | | string[] PotentialsStringArray = tables[17].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Potentials = new int[PotentialsStringArray.Length]; |
| | | for (int i=0;i<PotentialsStringArray.Length;i++) |
| | | { |
| | | int.TryParse(PotentialsStringArray[i],out Potentials[i]); |
| | | }
|
| | | int.TryParse(tables[17],out EffectID); |
| | |
|
| | | string[] SkillPowerStringArray = tables[18].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SkillPower = new int[SkillPowerStringArray.Length]; |
| | | for (int i=0;i<SkillPowerStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SkillPowerStringArray[i],out SkillPower[i]); |
| | | }
|
| | | Verse = tables[18].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
| | |
|
| | | NeedItem = tables[19];
|
| | | int.TryParse(tables[19],out ShowNetGotEffect); |
| | |
|
| | | int.TryParse(tables[20],out EffectID); |
| | | int.TryParse(tables[20],out PreferredStage); |
| | |
|
| | | Verse = tables[21].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
| | |
|
| | | int.TryParse(tables[22],out ShowNetGotEffect); |
| | |
|
| | | int.TryParse(tables[23],out PreferredStage); |
| | |
|
| | | int.TryParse(tables[24],out UIScale); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | static Dictionary<string, TreasureConfig> configs = new Dictionary<string, TreasureConfig>();
|
| | | public static TreasureConfig Get(string id)
|
| | | { |
| | | if (!inited)
|
| | | {
|
| | | Debug.Log("TreasureConfig 还未完成初始化。");
|
| | | return null;
|
| | | }
|
| | | |
| | | if (configs.ContainsKey(id))
|
| | | {
|
| | | return configs[id];
|
| | | }
|
| | |
|
| | | TreasureConfig config = null;
|
| | | if (rawDatas.ContainsKey(id))
|
| | | {
|
| | | config = configs[id] = new TreasureConfig(rawDatas[id]);
|
| | | rawDatas.Remove(id);
|
| | | }
|
| | |
|
| | | return config;
|
| | | }
|
| | |
|
| | | public static TreasureConfig Get(int id)
|
| | | {
|
| | | return Get(id.ToString());
|
| | | }
|
| | |
|
| | | public static List<string> GetKeys()
|
| | | {
|
| | | var keys = new List<string>();
|
| | | keys.AddRange(configs.Keys);
|
| | | keys.AddRange(rawDatas.Keys);
|
| | | return keys;
|
| | | }
|
| | |
|
| | | public static List<TreasureConfig> GetValues()
|
| | | {
|
| | | var values = new List<TreasureConfig>();
|
| | | values.AddRange(configs.Values);
|
| | |
|
| | | var keys = new List<string>(rawDatas.Keys);
|
| | | foreach (var key in keys)
|
| | | {
|
| | | values.Add(Get(key));
|
| | | }
|
| | |
|
| | | return values;
|
| | | }
|
| | |
|
| | | public static bool Has(string id)
|
| | | {
|
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
|
| | | }
|
| | |
|
| | | public static bool Has(int id)
|
| | | {
|
| | | return Has(id.ToString());
|
| | | }
|
| | |
|
| | | public static bool inited { get; private set; }
|
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
|
| | | public static void Init(bool sync=false)
|
| | | {
|
| | | inited = false;
|
| | | var path = string.Empty;
|
| | | if (AssetSource.refdataFromEditor)
|
| | | {
|
| | | path = ResourcesPath.CONFIG_FODLER +"/Treasure.txt";
|
| | | }
|
| | | else
|
| | | {
|
| | | path = AssetVersionUtility.GetAssetFilePath("config/Treasure.txt");
|
| | | }
|
| | |
|
| | | var tempConfig = new TreasureConfig();
|
| | | var preParse = tempConfig is IConfigPostProcess;
|
| | |
|
| | | if (sync)
|
| | | {
|
| | | var lines = File.ReadAllLines(path);
|
| | | if (!preParse)
|
| | | {
|
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3);
|
| | | }
|
| | | for (int i = 3; i < lines.Length; i++)
|
| | | {
|
| | | try |
| | | {
|
| | | var line = lines[i];
|
| | | var index = line.IndexOf("\t");
|
| | | if (index == -1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var id = line.Substring(0, index);
|
| | |
|
| | | if (preParse)
|
| | | {
|
| | | var config = new TreasureConfig(line);
|
| | | configs[id] = config;
|
| | | (config as IConfigPostProcess).OnConfigParseCompleted();
|
| | | }
|
| | | else
|
| | | {
|
| | | rawDatas[id] = line;
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | Debug.LogError(ex);
|
| | | }
|
| | | }
|
| | | inited = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | ThreadPool.QueueUserWorkItem((object _object) =>
|
| | | {
|
| | | var lines = File.ReadAllLines(path);
|
| | | if (!preParse)
|
| | | {
|
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3);
|
| | | }
|
| | | for (int i = 3; i < lines.Length; i++)
|
| | | {
|
| | | try |
| | | {
|
| | | var line = lines[i];
|
| | | var index = line.IndexOf("\t");
|
| | | if (index == -1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var id = line.Substring(0, index);
|
| | |
|
| | | if (preParse)
|
| | | {
|
| | | var config = new TreasureConfig(line);
|
| | | configs[id] = config;
|
| | | (config as IConfigPostProcess).OnConfigParseCompleted();
|
| | | }
|
| | | else
|
| | | {
|
| | | rawDatas[id] = line;
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | Debug.LogError(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | inited = true;
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | int.TryParse(tables[21],out UIScale); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, TreasureConfig> configs = new Dictionary<string, TreasureConfig>(); |
| | | public static TreasureConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("TreasureConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | TreasureConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new TreasureConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static TreasureConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<TreasureConfig> GetValues() |
| | | { |
| | | var values = new List<TreasureConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/Treasure.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/Treasure.txt"); |
| | | } |
| | | |
| | | var tempConfig = new TreasureConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new TreasureConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new TreasureConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Thursday, February 14, 2019 |
| | | // [ Date ]: Wednesday, February 20, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public partial class TreasureSkillConfig |
| | | { |
| | | |
| | | public readonly int ID; |
| | | public readonly int SkillType; |
| | | public readonly int SkillLv; |
| | | public readonly int MeterialNum1; |
| | | public readonly int InitialRate; |
| | | public readonly int[] Meterial2ID; |
| | | public readonly int[] MeterialNum2; |
| | | public readonly int[] Rate; |
| | | public readonly int id;
|
| | | public readonly int limitSkillId;
|
| | | public readonly int limitLevel; |
| | | |
| | | public TreasureSkillConfig() |
| | | { |
| | |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out ID); |
| | | |
| | | int.TryParse(tables[1],out SkillType); |
| | | |
| | | int.TryParse(tables[2],out SkillLv); |
| | | |
| | | int.TryParse(tables[3],out MeterialNum1); |
| | | |
| | | int.TryParse(tables[4],out InitialRate); |
| | | |
| | | string[] Meterial2IDStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Meterial2ID = new int[Meterial2IDStringArray.Length]; |
| | | for (int i=0;i<Meterial2IDStringArray.Length;i++) |
| | | { |
| | | int.TryParse(Meterial2IDStringArray[i],out Meterial2ID[i]); |
| | | } |
| | | |
| | | string[] MeterialNum2StringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | MeterialNum2 = new int[MeterialNum2StringArray.Length]; |
| | | for (int i=0;i<MeterialNum2StringArray.Length;i++) |
| | | { |
| | | int.TryParse(MeterialNum2StringArray[i],out MeterialNum2[i]); |
| | | } |
| | | |
| | | string[] RateStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Rate = new int[RateStringArray.Length]; |
| | | for (int i=0;i<RateStringArray.Length;i++) |
| | | { |
| | | int.TryParse(RateStringArray[i],out Rate[i]); |
| | | } |
| | | int.TryParse(tables[0],out id); |
| | |
|
| | | int.TryParse(tables[1],out limitSkillId); |
| | |
|
| | | int.TryParse(tables[2],out limitLevel); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | public delegate void SkillChangeHandler(int OldSkillId, int NewSkillId);
|
| | | public static event SkillChangeHandler SkillChangeEvent;
|
| | |
|
| | | TreasureModel m_Model;
|
| | | TreasureModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>()); } }
|
| | | PlayerMountDatas m_HorseModel;
|
| | | PlayerMountDatas horsemodel
|
| | | {
|
| | |
| | | onMainModel.XpSkill(vNetData.NewSkillID, vNetData.RemainTime);
|
| | |
|
| | |
|
| | | //model.UpdateTreasurePotentialInfo(vNetData.OldSkillID, vNetData.NewSkillID);
|
| | | ModelCenter.Instance.GetModel<TreasureSkillModel>().OnReceivePackage(vNetData.OldSkillID, vNetData.NewSkillID);
|
| | | ModelCenter.Instance.GetModel<TalentModel>().UpdateTalentSkill(vNetData.OldSkillID, vNetData.NewSkillID);
|
| | | ModelCenter.Instance.GetModel<JadeDynastySkillModel>().OnReceivePackage(vNetData);
|
| | | if (vNetData != null)
|
| New file |
| | |
| | | #if USE_UNI_LUA |
| | | using LuaAPI = UniLua.Lua; |
| | | using RealStatePtr = UniLua.ILuaState; |
| | | using LuaCSFunction = UniLua.CSharpFunctionDelegate; |
| | | #else |
| | | using LuaAPI = XLua.LuaDLL.Lua; |
| | | using RealStatePtr = System.IntPtr; |
| | | using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; |
| | | #endif |
| | | |
| | | using XLua; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | namespace XLua.CSObjectWrap |
| | | { |
| | | using Utils = XLua.Utils; |
| | | public class SkillClassifingConfigWrap |
| | | { |
| | | public static void __Register(RealStatePtr L) |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(SkillClassifingConfig); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 5, 0); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillID", _g_get_SkillID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillTypeID", _g_get_SkillTypeID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "UseType", _g_get_UseType); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "FuncType", _g_get_FuncType); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillLV", _g_get_SkillLV); |
| | | |
| | | |
| | | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | | null, null, null); |
| | | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 6, 1, 0); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Get", _m_Get_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetKeys", _m_GetKeys_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetValues", _m_GetValues_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Has", _m_Has_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Init", _m_Init_xlua_st_); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "inited", _g_get_inited); |
| | | |
| | | |
| | | |
| | | Utils.EndClassRegister(type, L, translator); |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __CreateInstance(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | if(LuaAPI.lua_gettop(L) == 1) |
| | | { |
| | | |
| | | SkillClassifingConfig gen_ret = new SkillClassifingConfig(); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | if(LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) |
| | | { |
| | | string _input = LuaAPI.lua_tostring(L, 2); |
| | | |
| | | SkillClassifingConfig gen_ret = new SkillClassifingConfig(_input); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to SkillClassifingConfig constructor!"); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Get_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | |
| | | if(gen_param_count == 1&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) |
| | | { |
| | | int _id = LuaAPI.xlua_tointeger(L, 1); |
| | | |
| | | SkillClassifingConfig gen_ret = SkillClassifingConfig.Get( _id ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) |
| | | { |
| | | string _id = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | SkillClassifingConfig gen_ret = SkillClassifingConfig.Get( _id ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | return LuaAPI.luaL_error(L, "invalid arguments to SkillClassifingConfig.Get!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetKeys_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | System.Collections.Generic.List<string> gen_ret = SkillClassifingConfig.GetKeys( ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetValues_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | System.Collections.Generic.List<SkillClassifingConfig> gen_ret = SkillClassifingConfig.GetValues( ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Has_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | |
| | | if(gen_param_count == 1&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)) |
| | | { |
| | | int _id = LuaAPI.xlua_tointeger(L, 1); |
| | | |
| | | bool gen_ret = SkillClassifingConfig.Has( _id ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) |
| | | { |
| | | string _id = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | bool gen_ret = SkillClassifingConfig.Has( _id ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | return LuaAPI.luaL_error(L, "invalid arguments to SkillClassifingConfig.Has!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Init_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | |
| | | if(gen_param_count == 1&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 1)) |
| | | { |
| | | bool _sync = LuaAPI.lua_toboolean(L, 1); |
| | | |
| | | SkillClassifingConfig.Init( _sync ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | if(gen_param_count == 0) |
| | | { |
| | | |
| | | SkillClassifingConfig.Init( ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | return LuaAPI.luaL_error(L, "invalid arguments to SkillClassifingConfig.Init!"); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_inited(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | LuaAPI.lua_pushboolean(L, SkillClassifingConfig.inited); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_SkillID(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | SkillClassifingConfig gen_to_be_invoked = (SkillClassifingConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.SkillID); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_SkillTypeID(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | SkillClassifingConfig gen_to_be_invoked = (SkillClassifingConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.SkillTypeID); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_UseType(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | SkillClassifingConfig gen_to_be_invoked = (SkillClassifingConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.UseType); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_FuncType(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | SkillClassifingConfig gen_to_be_invoked = (SkillClassifingConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.FuncType); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_SkillLV(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | SkillClassifingConfig gen_to_be_invoked = (SkillClassifingConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.SkillLV); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
copy from System/Treasure/TreasureCollectPanel.cs.meta
copy to Lua/Gen/SkillClassifingConfigWrap.cs.meta
| File was copied from System/Treasure/TreasureCollectPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cb964a5a91c90c478bba3d8a2c1f030 |
| | | timeCreated: 1507533761 |
| | | guid: e7bad9fbfb1757543aa1413d6c4814f5 |
| | | timeCreated: 1550718687 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(SkillConfig); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 1, 74, 0); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 74, 0); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnConfigParseCompleted", _m_OnConfigParseCompleted); |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillID", _g_get_SkillID); |
| | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | | null, null, null); |
| | | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 11, 1, 0); |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 12, 1, 0); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Get", _m_Get_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetKeys", _m_GetKeys_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetValues", _m_GetValues_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Has", _m_Has_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Init", _m_Init_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "SkillClassifingInit", _m_SkillClassifingInit_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetSkillWithOccpyAndType", _m_GetSkillWithOccpyAndType_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetSkills", _m_GetSkills_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetSkillActive", _m_GetSkillActive_xlua_st_); |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_OnConfigParseCompleted(RealStatePtr L) |
| | | static int _m_SkillClassifingInit_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | SkillConfig gen_to_be_invoked = (SkillConfig)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | SkillConfig.SkillClassifingInit( ); |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(TreasureConfig); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 25, 0); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 22, 0); |
| | | |
| | | |
| | | |
| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "MapId", _g_get_MapId); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "LineId", _g_get_LineId); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "ChallengeLevel", _g_get_ChallengeLevel); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Potentials", _g_get_Potentials); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillPower", _g_get_SkillPower); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "NeedItem", _g_get_NeedItem); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "EffectID", _g_get_EffectID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Verse", _g_get_Verse); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "ShowNetGotEffect", _g_get_ShowNetGotEffect); |
| | |
| | | |
| | | TreasureConfig gen_to_be_invoked = (TreasureConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.ChallengeLevel); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_Potentials(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureConfig gen_to_be_invoked = (TreasureConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.Potentials); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_SkillPower(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureConfig gen_to_be_invoked = (TreasureConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.SkillPower); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_NeedItem(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureConfig gen_to_be_invoked = (TreasureConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushstring(L, gen_to_be_invoked.NeedItem); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(TreasureSkillConfig); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 8, 0); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 3, 0); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "ID", _g_get_ID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillType", _g_get_SkillType); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "SkillLv", _g_get_SkillLv); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "MeterialNum1", _g_get_MeterialNum1); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "InitialRate", _g_get_InitialRate); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Meterial2ID", _g_get_Meterial2ID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "MeterialNum2", _g_get_MeterialNum2); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Rate", _g_get_Rate); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "id", _g_get_id); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "limitSkillId", _g_get_limitSkillId); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "limitLevel", _g_get_limitLevel); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_ID(RealStatePtr L) |
| | | static int _g_get_id(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.ID); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.id); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_SkillType(RealStatePtr L) |
| | | static int _g_get_limitSkillId(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.SkillType); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.limitSkillId); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_SkillLv(RealStatePtr L) |
| | | static int _g_get_limitLevel(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.SkillLv); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_MeterialNum1(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.MeterialNum1); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_InitialRate(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.InitialRate); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_Meterial2ID(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.Meterial2ID); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_MeterialNum2(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.MeterialNum2); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_Rate(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TreasureSkillConfig gen_to_be_invoked = (TreasureSkillConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.Rate); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.limitLevel); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | translator.DelayWrapLoader(typeof(SignInConfig), SignInConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(SkillClassifingConfig), SkillClassifingConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(SkillConfig), SkillConfigWrap.__Register); |
| | | |
| | | |
| | |
| | | |
| | | translator.DelayWrapLoader(typeof(WingRefineAttrConfig), WingRefineAttrConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(WingRefineExpConfig), WingRefineExpConfigWrap.__Register); |
| | | |
| | | } |
| | | |
| | | static void wrapInit4(LuaEnv luaenv, ObjectTranslator translator) |
| | | { |
| | | |
| | | translator.DelayWrapLoader(typeof(WingRefineExpConfig), WingRefineExpConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(WorldBossConfig), WorldBossConfigWrap.__Register); |
| | | |
| | |
| | | |
| | | translator.DelayWrapLoader(typeof(UnityEngine.Behaviour), UnityEngineBehaviourWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(UnityEngine.Transform), UnityEngineTransformWrap.__Register); |
| | | |
| | | } |
| | | |
| | | static void wrapInit5(LuaEnv luaenv, ObjectTranslator translator) |
| | | { |
| | | |
| | | translator.DelayWrapLoader(typeof(UnityEngine.Transform), UnityEngineTransformWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(UnityEngine.Resources), UnityEngineResourcesWrap.__Register); |
| | | |
| | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.DungeonAssistModel), SnxxzUIDungeonAssistModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.Dungeon), SnxxzUIDungeonWrap.__Register); |
| | | |
| | | } |
| | | |
| | | static void wrapInit6(LuaEnv luaenv, ObjectTranslator translator) |
| | | { |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.Dungeon), SnxxzUIDungeonWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.DungeonLiquidModel), SnxxzUIDungeonLiquidModelWrap.__Register); |
| | | |
| | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.BatchUseModel), SnxxzUIBatchUseModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.KingTreasureShowModel), SnxxzUIKingTreasureShowModelWrap.__Register); |
| | | |
| | | } |
| | | |
| | | static void wrapInit7(LuaEnv luaenv, ObjectTranslator translator) |
| | | { |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.KingTreasureShowModel), SnxxzUIKingTreasureShowModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(KnapSackEventMgr), KnapSackEventMgrWrap.__Register); |
| | | |
| | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.MagicianModel), SnxxzUIMagicianModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.RoleModel), SnxxzUIRoleModelWrap.__Register); |
| | | |
| | | } |
| | | |
| | | static void wrapInit8(LuaEnv luaenv, ObjectTranslator translator) |
| | | { |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.RoleModel), SnxxzUIRoleModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.RolePointModel), SnxxzUIRolePointModelWrap.__Register); |
| | | |
| | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.LevelGiftModel), SnxxzUILevelGiftModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.MultipleExpModel), SnxxzUIMultipleExpModelWrap.__Register); |
| | | |
| | | } |
| | | |
| | | static void wrapInit9(LuaEnv luaenv, ObjectTranslator translator) |
| | | { |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.MultipleExpModel), SnxxzUIMultipleExpModelWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(Snxxz.UI.MultipleRealmPointModel), SnxxzUIMultipleRealmPointModelWrap.__Register); |
| | | |
| | | |
| | |
| | | <type fullname="SceneReplaceConfig" preserve="all"/> |
| | | <type fullname="SceneShadowConfig" preserve="all"/> |
| | | <type fullname="SignInConfig" preserve="all"/> |
| | | <type fullname="SkillClassifingConfig" preserve="all"/> |
| | | <type fullname="SkillConfig" preserve="all"/> |
| | | <type fullname="SkillFrameAnimationConfig" preserve="all"/> |
| | | <type fullname="StoreConfig" preserve="all"/> |
| | |
| | | }
|
| | | if (PlayerDatas.Instance.skill.ContainsQuickSkill(skillId) == -1)
|
| | | {
|
| | | WindowCenter.Instance.Open<SkillPanel>();
|
| | | WindowCenter.Instance.Open<SkillWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | void SkillButton()
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<SkillPanel>();
|
| | | WindowCenter.Instance.Open<SkillWin>();
|
| | |
|
| | |
|
| | | //DesignDebug.Log("技能按钮");
|
| | |
| | | Treasure treasure; |
| | | if (treasureModel.TryGetTreasure(treasures[i], out treasure)) |
| | | { |
| | | _SkillAndPreTreasure[treasure.unlockSkill] = treasures[i]; |
| | | _SkillAndPreTreasure[treasure.skillId] = treasures[i]; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (Gold >= NeedMoney)
|
| | | {
|
| | | taskmodel.CompletionOfTask(TaskID);
|
| | | if (WindowCenter.Instance.IsOpen<SkillPanel>())
|
| | | if (WindowCenter.Instance.IsOpen<SkillWin>())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | [SerializeField] Text m_TreasureNameTxt;
|
| | | [SerializeField] Text m_SkillNameTxt;
|
| | | [SerializeField] Text m_SkillCoolDownTxt;
|
| | | [SerializeField] Text m_SkillLevel;
|
| | | [SerializeField] Text m_SkillDescTxt;
|
| | | [SerializeField] Button m_LeftBtn;
|
| | | [SerializeField] Button m_RightBtn;
|
| | |
| | | {
|
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<SkillModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | TreasureSkillModel treasureSkillModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); }
|
| | | }
|
| | |
|
| | | #region Built-in
|
| | |
| | | m_TreasureNameTxt.text = cfg.Skillsource;
|
| | | m_SkillDescTxt.text = UIHelper.ReplaceNewLine(cfg.Description);
|
| | | m_SkillCoolDownTxt.text = cfg.CoolDownTime == 0 ? string.Empty : Language.Get("L1065", cfg.CoolDownTime / 1000);
|
| | |
|
| | | TreasureSkill treasureSkill;
|
| | | var level = 0;
|
| | | if (treasureSkillModel.TryGetSkill(cfg.SkillTypeID, out treasureSkill))
|
| | | {
|
| | | level = treasureSkill.level;
|
| | | }
|
| | | m_SkillLevel.text = Language.Get("SkillActLevel", level);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public int PassOpenHoleCount()
|
| | | {
|
| | | var count = 0;
|
| | | for (int i = 0; i < 6; i++)
|
| | | for (int i = 0; i < passEquipCnt; i++)
|
| | | {
|
| | | if (IsPassSkillHoleOpen(i))
|
| | | {
|
| | |
| | | if (model.UnlockPassHole != 0)
|
| | | {
|
| | | var index = 0;
|
| | | for (int i = 0; i < equipPassSkills.Count; i++)
|
| | | for (int i = 0; i < model.passEquipCnt; i++)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | if (model.TryGetPassSkillLimit(i, out limit))
|
| | |
| | | {
|
| | | for (int i = 0; i < equipPassSkills.Count; i++)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleUnLimitColor;
|
| | | if (model.TryGetPassSkillLimit(i, out limit))
|
| | | equipPassSkills[i].gameObject.SetActive(i < model.passEquipCnt);
|
| | | if (i < model.passEquipCnt)
|
| | | {
|
| | | if (limit.level > 0)
|
| | | PassSkillLimit limit;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleUnLimitColor;
|
| | | if (model.TryGetPassSkillLimit(i, out limit))
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.LV < limit.level)
|
| | | if (limit.level > 0)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = Language.Get("PassSkillHoleLimitLv", limit.level);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.vipLv > 0)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < limit.vipLv)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = Language.Get("PassSkillHoleLimitVip", limit.vipLv);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.MountLv > 0)
|
| | | {
|
| | | if (promoteModel.GetMountTotallv() < limit.MountLv)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = Language.Get("PassSkillHoleLimitMount", limit.MountLv);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.OpenSkillSlots > 0)
|
| | | {
|
| | | if (!model.IsTaskHoleUnlock(limit.OpenSkillSlots) || model.UnlockPassHole == limit.OpenSkillSlots)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | |
|
| | | if (model.taskHoleDict.ContainsKey(limit.OpenSkillSlots))
|
| | | if (PlayerDatas.Instance.baseData.LV < limit.level)
|
| | | {
|
| | | var taskId = model.taskHoleDict[limit.OpenSkillSlots];
|
| | | var config = PyTaskConfig.Get(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV < config.lv)
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = Language.Get("PassSkillHoleLimitLv", limit.level);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.vipLv > 0)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < limit.vipLv)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = Language.Get("PassSkillHoleLimitVip", limit.vipLv);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.MountLv > 0)
|
| | | {
|
| | | if (promoteModel.GetMountTotallv() < limit.MountLv)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = Language.Get("PassSkillHoleLimitMount", limit.MountLv);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.OpenSkillSlots > 0)
|
| | | {
|
| | | if (!model.IsTaskHoleUnlock(limit.OpenSkillSlots) || model.UnlockPassHole == limit.OpenSkillSlots)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | |
|
| | | if (model.taskHoleDict.ContainsKey(limit.OpenSkillSlots))
|
| | | {
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get("PassSkillHoleLimitTask_6", config.lv));
|
| | | continue;
|
| | | var taskId = model.taskHoleDict[limit.OpenSkillSlots];
|
| | | var config = PyTaskConfig.Get(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV < config.lv)
|
| | | {
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get("PassSkillHoleLimitTask_6", config.lv));
|
| | | continue;
|
| | | }
|
| | | }
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots)));
|
| | | continue;
|
| | | }
|
| | | else if (model.IsImmediatelyUnlock(i)
|
| | | && model.IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | if (m_ImmediatelyUnlock.gameObject.activeSelf)
|
| | | {
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots)));
|
| | | continue;
|
| | | }
|
| | | else if (model.IsImmediatelyUnlock(i)
|
| | | && model.IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | if (m_ImmediatelyUnlock.gameObject.activeSelf)
|
| | | {
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | int _skillId = 0;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = string.Empty;
|
| | | equipPassSkills[i].skillData.m_LockImg.gameObject.SetActive(false);
|
| | | model.TryGetEquipPassSkills(model.presentSltPage, i, out _skillId);
|
| | | equipPassSkills[i].skillData.SetSkillData(_skillId);
|
| | | }
|
| | | int _skillId = 0;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = string.Empty;
|
| | | equipPassSkills[i].skillData.m_LockImg.gameObject.SetActive(false);
|
| | | model.TryGetEquipPassSkills(model.presentSltPage, i, out _skillId);
|
| | | equipPassSkills[i].skillData.SetSkillData(_skillId);
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckReplaceEquipSkill()
|
| | | {
|
| | | for (int i = 0; i < equipPassSkills.Count; i++)
|
| | | for (int i = 0; i < model.passEquipCnt; i++)
|
| | | {
|
| | | var rect = equipPassSkills[i].transform as RectTransform;
|
| | | var des = RectTransformUtility.CalculateRelativeRectTransformBounds(this.transform, rect);
|
| | | var src = RectTransformUtility.CalculateRelativeRectTransformBounds(this.transform, m_DragImg.rectTransform);
|
| | | var dis = Vector3.Distance(des.center, src.center);
|
| | | if (dis < rect.rect.width / 2)
|
| | | if (i < equipPassSkills.Count)
|
| | | {
|
| | | if (CheckOpenGetWays(i) != 0)
|
| | | var rect = equipPassSkills[i].transform as RectTransform;
|
| | | var des = RectTransformUtility.CalculateRelativeRectTransformBounds(this.transform, rect);
|
| | | var src = RectTransformUtility.CalculateRelativeRectTransformBounds(this.transform, m_DragImg.rectTransform);
|
| | | var dis = Vector3.Distance(des.center, src.center);
|
| | | if (dis < rect.rect.width / 2)
|
| | | {
|
| | | //SoundPlayer.Instance.PlayUIAudio(2);
|
| | | return;
|
| | | if (CheckOpenGetWays(i) != 0)
|
| | | {
|
| | | //SoundPlayer.Instance.PlayUIAudio(2);
|
| | | return;
|
| | | }
|
| | | model.SendEquipPassSkills(model.skillDragId, i);
|
| | | if (model.passSkillHoleRedpoints[i].state == RedPointState.Simple)
|
| | | {
|
| | | model.SetDayRemind();
|
| | | }
|
| | | break;
|
| | | }
|
| | | model.SendEquipPassSkills(model.skillDragId, i);
|
| | | if (model.passSkillHoleRedpoints[i].state == RedPointState.Simple)
|
| | | {
|
| | | model.SetDayRemind();
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class SkillWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Close;
|
| | | [SerializeField] Button m_Left;
|
| | | [SerializeField] Button m_Right;
|
| | | [SerializeField] FunctionButton m_ActSkill;
|
| | | [SerializeField] FunctionButton m_PassSkill;
|
| | | [SerializeField] FunctionButton m_Talent;
|
| | | [SerializeField] FunctionButton m_TreasureSkill;
|
| | | [SerializeField] FunctionButtonGroup m_FuncGroup;
|
| | | [Header("拖动延迟")]
|
| | | [SerializeField] float m_OnDragDelay = 0.1f;
|
| | |
|
| | | SkillModel m_Model;
|
| | | SkillModel model {
|
| | | get {
|
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<SkillModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | model.onDragDelay = m_OnDragDelay;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.onClick.AddListener(OnClose);
|
| | | m_ActSkill.onClick.AddListener(OnAccordFunc);
|
| | | m_PassSkill.onClick.AddListener(OnPassFunc);
|
| | | m_Talent.onClick.AddListener(OnTalentFunc);
|
| | | m_TreasureSkill.onClick.AddListener(OnTreasureSkillFunc);
|
| | | m_Left.onClick.AddListener(() => {
|
| | | m_FuncGroup.TriggerLast();
|
| | | });
|
| | | m_Right.onClick.AddListener(() => {
|
| | | m_FuncGroup.TriggerNext();
|
| | | });
|
| | | }
|
| | |
|
| | | private void OnPassFunc()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = m_PassSkill.order;
|
| | | WindowCenter.Instance.Open<SkillPassWin>();
|
| | | }
|
| | |
|
| | | private void OnTalentFunc()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = m_Talent.order;
|
| | | WindowCenter.Instance.Open<TalentWin>();
|
| | | }
|
| | |
|
| | | private void OnAccordFunc()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = m_ActSkill.order;
|
| | | WindowCenter.Instance.Open<SkillAccordWin>();
|
| | | }
|
| | |
|
| | | private void OnTreasureSkillFunc()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = m_TreasureSkill.order;
|
| | | WindowCenter.Instance.Open<SkillAccordWin>();
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | |
|
| | | if (functionOrder == 0 && model.jumpToPass)
|
| | | {
|
| | | functionOrder = m_PassSkill.order;
|
| | | model.jumpToPass = false;
|
| | | }
|
| | |
|
| | | m_FuncGroup.TriggerByOrder(functionOrder);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.jumpToPass = false;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | if (!WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | void OnClose()
|
| | | {
|
| | | CloseChild();
|
| | | CloseImmediately();
|
| | | }
|
| | |
|
| | | void CloseChild()
|
| | | {
|
| | | var children = WindowConfig.Get().FindChildWindows("SkillWin");
|
| | | foreach (var window in children)
|
| | | {
|
| | | WindowCenter.Instance.Close(window);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| File was renamed from System/Skill/SkillPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c683bffb2de22ee4cbda7aaaa1243e1d |
| | | timeCreated: 1498562046 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | | fileFormatVersion: 2
|
| | | guid: c683bffb2de22ee4cbda7aaaa1243e1d
|
| | | timeCreated: 1498562046
|
| | | licenseType: Free
|
| | | MonoImporter:
|
| | | serializedVersion: 2
|
| | | defaultReferences: []
|
| | | executionOrder: 0
|
| | | icon: {instanceID: 0}
|
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TreasurePotentialBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Transform m_ContainerLock;
|
| | | [SerializeField] Transform m_ContainerUnlock;
|
| | | [SerializeField] Text m_PotentialName;
|
| | | [SerializeField] Text m_PotentialLevel;
|
| | | [SerializeField] Text m_PotentialLimit;
|
| | | [SerializeField] Text m_PotentialCondition;
|
| | | [SerializeField] Image m_PotentialIcon;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] RedpointBehaviour m_Redpoint;
|
| | |
|
| | | int skillId = 0;
|
| | |
|
| | | TreasureSkillModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); }
|
| | | }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Func.AddListener(OnFunc);
|
| | | }
|
| | |
|
| | | public void Display(int skillId)
|
| | | {
|
| | | bool isOpen = model.IsPotentialUnlock(skillId);
|
| | | m_ContainerLock.gameObject.SetActive(!isOpen);
|
| | | m_ContainerUnlock.gameObject.SetActive(isOpen);
|
| | |
|
| | | TreasurePotential potential;
|
| | | if (model.TryGetPotential(skillId, out potential))
|
| | | {
|
| | | {
|
| | | var skillConfig = potential.GetSkillConfig(potential.level);
|
| | | m_PotentialName.text = skillConfig.SkillName;
|
| | | m_PotentialIcon.SetSprite(skillConfig.IconName);
|
| | | m_PotentialLimit.gameObject.SetActive(potential.level == 0);
|
| | | m_PotentialLevel.gameObject.SetActive(potential.level > 0);
|
| | | m_PotentialLevel.text = StringUtility.Contact("LV", potential.level);
|
| | | m_PotentialIcon.material = potential.level > 0 ? MaterialUtility.GetUIDefaultGraphicMaterial()
|
| | | : MaterialUtility.GetInstantiatedSpriteGrayMaterial();
|
| | | }
|
| | |
|
| | |
|
| | | if (!isOpen)
|
| | | {
|
| | | var treasureSkillId = 0;
|
| | | if (model.ContainsSkill(skillId, out treasureSkillId))
|
| | | {
|
| | | var skillConfig = SkillConfig.Get(treasureSkillId);
|
| | | m_PotentialCondition.text = Language.Get("TreasurePotentialUnlock", skillConfig.SkillName, potential.openLevel);
|
| | | }
|
| | | }
|
| | |
|
| | | m_Redpoint.redpointId = potential.levelUpRedpoint.id;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFunc()
|
| | | {
|
| | | bool isOpen = model.IsPotentialUnlock(skillId);
|
| | | if (isOpen)
|
| | | {
|
| | | TreasurePotentialLevelUpWin.selectPotentialId = skillId;
|
| | | WindowCenter.Instance.Open<TreasurePotentialLevelUpWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
copy from System/Treasure/TreasureCollectPanel.cs.meta
copy to System/Skill/TreasurePotentialBehaviour.cs.meta
| File was copied from System/Treasure/TreasureCollectPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cb964a5a91c90c478bba3d8a2c1f030 |
| | | timeCreated: 1507533761 |
| | | guid: c5024aa76e8f6f647aa17c0e4406cbff |
| | | timeCreated: 1550647552 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, February 20, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class TreasurePotentialLevelUpWin : Window
|
| | | {
|
| | | [SerializeField] Image m_SkillIcon;
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] Text m_SkillLevel;
|
| | | [SerializeField] Text m_FightPower;
|
| | | [SerializeField] Transform m_ContainerNow;
|
| | | [SerializeField] Text m_SkillDescNow;
|
| | | [SerializeField] Transform m_ContainerNext;
|
| | | [SerializeField] Text m_SkillDescNext;
|
| | | [SerializeField] Transform m_ContainerLevelUp;
|
| | | [SerializeField] Text m_PreSkillCondition;
|
| | | [SerializeField] Text m_CostItemCondition;
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Transform m_ContainerMax;
|
| | | [SerializeField] Button m_LevelUp;
|
| | | [SerializeField] Button m_GetWay;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | public static int selectPotentialId = 0;
|
| | |
|
| | | TreasureSkillModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_LevelUp.AddListener(LevelUp);
|
| | | m_Close.AddListener(CloseClick);
|
| | | m_GetWay.AddListener(GetWay);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | model.skillLevelUpRefresh += SkillLevelUpRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.skillLevelUpRefresh -= SkillLevelUpRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void SkillLevelUpRefresh(int id)
|
| | | {
|
| | | if (selectPotentialId == id)
|
| | | {
|
| | | Display();
|
| | | }
|
| | | }
|
| | |
|
| | | public void Display()
|
| | | {
|
| | | TreasurePotential potential;
|
| | | if (model.TryGetPotential(selectPotentialId, out potential))
|
| | | {
|
| | | var config = potential.GetSkillConfig(potential.level);
|
| | | m_SkillIcon.SetSprite(config.IconName);
|
| | | m_SkillName.text = config.SkillName;
|
| | | m_SkillLevel.text = StringUtility.Contact("LV", potential.level);
|
| | | m_FightPower.text = config.FightPower.ToString();
|
| | |
|
| | | var isMax = potential.level >= potential.maxLevel;
|
| | | m_ContainerNext.gameObject.SetActive(!isMax);
|
| | |
|
| | | if (potential.level == 0)
|
| | | {
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SkillDescNow.text = config.Description;
|
| | | }
|
| | |
|
| | | if (!isMax)
|
| | | {
|
| | | var nextConfig = potential.GetSkillConfig(potential.level + 1);
|
| | | m_SkillDescNext.text = config.Description;
|
| | | }
|
| | |
|
| | | m_ContainerLevelUp.gameObject.SetActive(!isMax);
|
| | | m_ContainerMax.gameObject.SetActive(isMax);
|
| | | m_GetWay.gameObject.SetActive(!isMax);
|
| | |
|
| | | if (!isMax)
|
| | | {
|
| | | var requireSkillConfig = SkillConfig.Get(config.LearnSkillReq);
|
| | | TreasurePotential requirePotential;
|
| | | if (model.TryGetPotential(config.LearnSkillReq, out requirePotential))
|
| | | {
|
| | | m_Item.SetItem(config.ExAttr4, config.ExAttr5);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var error = 0;
|
| | | bool satisfyLevelUp = model.TryLevelUpPotential(selectPotentialId, out error);
|
| | | m_LevelUp.gameObject.SetActive(satisfyLevelUp);
|
| | | }
|
| | |
|
| | | private void GetWay()
|
| | | {
|
| | | TreasurePotential potential;
|
| | | if (model.TryGetPotential(selectPotentialId, out potential))
|
| | | {
|
| | | var config = potential.GetSkillConfig(potential.level);
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(config.ExAttr4);
|
| | | }
|
| | | }
|
| | |
|
| | | private void LevelUp()
|
| | | {
|
| | | var error = 0;
|
| | | if (model.TryLevelUpPotential(selectPotentialId, out error))
|
| | | {
|
| | | var pak = new C0304_tagCAddSkillPoint();
|
| | | pak.SkillID = (ushort)selectPotentialId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.DisplayLevelUpError(error);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from System/Treasure/TreasureCollectPanel.cs.meta
copy to System/Skill/TreasurePotentialLevelUpWin.cs.meta
| File was copied from System/Treasure/TreasureCollectPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cb964a5a91c90c478bba3d8a2c1f030 |
| | | timeCreated: 1507533761 |
| | | guid: e0638481d824bb1458261240ff26eba0 |
| | | timeCreated: 1550653809 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TreasureSkillCell : CellView
|
| | | {
|
| | | [SerializeField] Image m_SkillIcon;
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] Text m_SkillLevel;
|
| | | [SerializeField] Transform m_ContainerLock;
|
| | | [SerializeField] Text m_SkillCondition;
|
| | | [SerializeField] Transform m_ContainerSelect;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] RedpointBehaviour m_Redpoint;
|
| | |
|
| | | int skillId;
|
| | |
|
| | | TreasureSkillModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); }
|
| | | }
|
| | |
|
| | | TreasureModel treasureModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
| | | }
|
| | |
|
| | | public void Display(int skillId)
|
| | | {
|
| | | this.skillId = skillId;
|
| | |
|
| | | DisplayBase();
|
| | |
|
| | | var treasureId = treasureModel.GetTreasureBySkillId(skillId);
|
| | |
|
| | | var isSkillUnlock = false;
|
| | |
|
| | | Treasure treasure;
|
| | | if (treasureModel.TryGetTreasure(treasureId, out treasure))
|
| | | {
|
| | | isSkillUnlock = treasure.state == TreasureState.Collected;
|
| | | }
|
| | |
|
| | | m_ContainerLock.gameObject.SetActive(!isSkillUnlock);
|
| | | m_SkillIcon.material = isSkillUnlock ? MaterialUtility.GetUIDefaultGraphicMaterial() :
|
| | | MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_ContainerSelect.gameObject.SetActive(skillId == model.selectSkill);
|
| | | m_SkillLevel.gameObject.SetActive(isSkillUnlock);
|
| | |
|
| | | TreasureSkill treasureSkill;
|
| | | if (model.TryGetSkill(skillId, out treasureSkill))
|
| | | {
|
| | | m_SkillLevel.text = treasureSkill.level.ToString();
|
| | | m_Redpoint.redpointId = treasureSkill.redpoint.id;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBase()
|
| | | {
|
| | | var config = SkillConfig.Get(skillId);
|
| | | m_SkillIcon.SetSprite(config.IconName);
|
| | | m_SkillName.text = config.SkillName;
|
| | |
|
| | | var treasureId = treasureModel.GetTreasureBySkillId(skillId);
|
| | | var treasureConfig = TreasureConfig.Get(treasureId);
|
| | | if (treasureConfig != null)
|
| | | {
|
| | | m_SkillCondition.text = Language.Get("TreasureSkillUnlock", treasureConfig.Name);
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| File was renamed from System/Treasure/TreasureCollectPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cb964a5a91c90c478bba3d8a2c1f030 |
| | | timeCreated: 1507533761 |
| | | guid: fe04066f80cc08c4690c7333bff82cf1 |
| | | timeCreated: 1550643246 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TreasureSkillModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, TreasureSkill> treasureSkills = new Dictionary<int, TreasureSkill>();
|
| | | Dictionary<int, List<int>> jobTreasureSkills = new Dictionary<int, List<int>>();
|
| | | List<int> skillLevelUpItems = new List<int>();
|
| | |
|
| | | int m_SelectSkill;
|
| | | public int selectSkill
|
| | | {
|
| | | get { return m_SelectSkill; }
|
| | | set
|
| | | {
|
| | | if (selectSkill != value)
|
| | | {
|
| | | selectSkill = value;
|
| | | if (selectRefresh != null)
|
| | | {
|
| | | selectRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | bool serverInited = false;
|
| | |
|
| | | public bool requireRemind { get; private set; }
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(103, 10304);
|
| | | public const int REDPOINTID_BASE = 10304000;
|
| | | public static int redpointIndex = 100;
|
| | |
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | public event Action selectRefresh;
|
| | | public event Action<int> treasureSkillRefresh;
|
| | | public event Action<int> skillLevelUpRefresh;
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | |
|
| | | packModel.RefreshItemCountAct += RefreshItemCountAct;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | foreach (var skill in treasureSkills.Values)
|
| | | {
|
| | | skill.Reset();
|
| | | }
|
| | | serverInited = false;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | serverInited = true;
|
| | | requireRemind = true;
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | packModel.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int id)
|
| | | {
|
| | | if (id == 82)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType packType, int arg2, int itemId)
|
| | | {
|
| | | if (packType == PackType.rptItem && skillLevelUpItems.Contains(itemId))
|
| | | {
|
| | | if (serverInited)
|
| | | {
|
| | | requireRemind = true;
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var configs = TreasureSkillConfig.GetValues();
|
| | | var index = 0;
|
| | | foreach (var config in configs)
|
| | | {
|
| | | TreasureSkill treasureSkill;
|
| | | if (!treasureSkills.TryGetValue(config.limitSkillId, out treasureSkill))
|
| | | {
|
| | | treasureSkill = new TreasureSkill(config.limitSkillId, index);
|
| | | treasureSkills.Add(config.limitSkillId, treasureSkill);
|
| | | index++;
|
| | | }
|
| | | treasureSkill.potentials.Add(new TreasurePotential(config.id, 0,
|
| | | config.limitLevel, treasureSkill.redpoint.id));
|
| | | var skillConfig = SkillConfig.Get(config.limitSkillId);
|
| | |
|
| | | List<int> skills;
|
| | | if (!jobTreasureSkills.TryGetValue(skillConfig.UseType, out skills))
|
| | | {
|
| | | skills = new List<int>();
|
| | | jobTreasureSkills.Add(skillConfig.UseType, skills);
|
| | | }
|
| | | if (!skills.Contains(config.limitSkillId))
|
| | | {
|
| | | skills.Add(config.limitSkillId);
|
| | | }
|
| | | }
|
| | |
|
| | | foreach (var skill in treasureSkills.Values)
|
| | | {
|
| | | for (int i = 1; i <= skill.maxLevel; i++)
|
| | | {
|
| | | var config = skill.GetSkillConfig(i);
|
| | | if (!skillLevelUpItems.Contains(config.ExAttr4))
|
| | | {
|
| | | skillLevelUpItems.Add(config.ExAttr4);
|
| | | }
|
| | | }
|
| | |
|
| | | foreach (var potential in skill.potentials)
|
| | | {
|
| | | for (int i = 1; i <= potential.maxLevel; i++)
|
| | | {
|
| | | var config = skill.GetSkillConfig(i);
|
| | | if (!skillLevelUpItems.Contains(config.ExAttr4))
|
| | | {
|
| | | skillLevelUpItems.Add(config.ExAttr4);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetSkills(out List<int> skills)
|
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var useType = (int)Mathf.Pow(2, job);
|
| | | return jobTreasureSkills.TryGetValue(useType, out skills);
|
| | | }
|
| | |
|
| | | public bool TryGetSkill(int skillId, out TreasureSkill treasureSkill)
|
| | | {
|
| | | return treasureSkills.TryGetValue(skillId, out treasureSkill);
|
| | | }
|
| | |
|
| | | public bool TryGetPotential(int skillId, out TreasurePotential potential)
|
| | | {
|
| | | var treasureSkillId = 0;
|
| | | potential = null;
|
| | | if (ContainsSkill(skillId, out treasureSkillId))
|
| | | {
|
| | | var treasureSkill = treasureSkills[treasureSkillId];
|
| | | potential = treasureSkill.potentials.Find((x) =>
|
| | | {
|
| | | return x.id == skillId;
|
| | | });
|
| | | return potential != null;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsPotentialUnlock(int skillId)
|
| | | {
|
| | | var treasureSkillId = 0;
|
| | | if (ContainsSkill(skillId, out treasureSkillId))
|
| | | {
|
| | | var treasureSkill = treasureSkills[treasureSkillId];
|
| | | TreasurePotential potential;
|
| | | if (TryGetPotential(skillId, out potential))
|
| | | {
|
| | | return treasureSkill.level >= potential.openLevel;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void OnReceivePackage(int oldSkillID, int newSkillID)
|
| | | {
|
| | | var config = SkillConfig.Get(newSkillID);
|
| | | var skillTypeId = config.SkillTypeID;
|
| | | var treasureSkillId = 0;
|
| | | if (ContainsSkill(skillTypeId, out treasureSkillId))
|
| | | {
|
| | | var treasureSkill = treasureSkills[treasureSkillId];
|
| | |
|
| | | var level = 0;
|
| | | if (skillTypeId == treasureSkillId)
|
| | | {
|
| | | level = treasureSkill.level;
|
| | | }
|
| | | else
|
| | | {
|
| | | TreasurePotential potential;
|
| | | if (TryGetPotential(skillTypeId, out potential))
|
| | | {
|
| | | level = potential.level;
|
| | | }
|
| | | }
|
| | |
|
| | | treasureSkill.Refresh(newSkillID);
|
| | |
|
| | | bool levelUp = false;
|
| | | if (skillTypeId == treasureSkillId)
|
| | | {
|
| | | levelUp = treasureSkill.level > level;
|
| | | }
|
| | | else
|
| | | {
|
| | | TreasurePotential potential;
|
| | | if (TryGetPotential(skillTypeId, out potential))
|
| | | {
|
| | | levelUp = potential.level > level;
|
| | | }
|
| | | }
|
| | |
|
| | | if (levelUp && serverInited)
|
| | | {
|
| | | if (skillLevelUpRefresh != null)
|
| | | {
|
| | | skillLevelUpRefresh(skillTypeId);
|
| | | }
|
| | | }
|
| | |
|
| | | if (treasureSkillRefresh != null)
|
| | | {
|
| | | treasureSkillRefresh(skillTypeId);
|
| | | }
|
| | |
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryLevelUpTreasureSkill(int skillId, out int error)
|
| | | {
|
| | | error = 0;
|
| | | TreasureSkill skill;
|
| | | if (TryGetSkill(skillId, out skill))
|
| | | {
|
| | | if (skill.level >= skill.maxLevel)
|
| | | {
|
| | | error = 1;
|
| | | return false;
|
| | | }
|
| | | var config = skill.GetSkillConfig(skill.level);
|
| | | var count = packModel.GetItemCountByID(PackType.rptItem, config.ExAttr4);
|
| | | if (count < config.ExAttr5)
|
| | | {
|
| | | error = 2;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool TryLevelUpPotential(int skillId, out int error)
|
| | | {
|
| | | error = 0;
|
| | | TreasurePotential potential;
|
| | | if (TryGetPotential(skillId, out potential))
|
| | | {
|
| | | if (potential.level >= potential.maxLevel)
|
| | | {
|
| | | error = 11;
|
| | | return false;
|
| | | }
|
| | | var config = potential.GetSkillConfig(potential.level);
|
| | | if (config.LearnSkillReq != 0)
|
| | | {
|
| | | TreasurePotential requirePotential;
|
| | | if (!TryGetPotential(config.LearnSkillReq, out requirePotential)
|
| | | || requirePotential.level < config.LearnSkillLV)
|
| | | {
|
| | | error = 12;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | var count = packModel.GetItemCountByID(PackType.rptItem, config.ExAttr4);
|
| | | if (count < config.ExAttr5)
|
| | | {
|
| | | error = 13;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public void DisplayLevelUpError(int error)
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | case 1:
|
| | | break;
|
| | | case 2:
|
| | | break;
|
| | | case 11:
|
| | | break;
|
| | | case 12:
|
| | | break;
|
| | | case 13:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool ContainsSkill(int skillId, out int treasureSkillId)
|
| | | {
|
| | | treasureSkillId = 0;
|
| | | foreach (var skill in treasureSkills.Values)
|
| | | {
|
| | | if (skill.skillId == skillId)
|
| | | {
|
| | | treasureSkillId = skill.skillId;
|
| | | return true;
|
| | | }
|
| | | if (skill.potentials.FindIndex((x) =>
|
| | | {
|
| | | return x.id == skillId;
|
| | | }) != -1)
|
| | | {
|
| | | treasureSkillId = skill.skillId;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void SetAlreadyRemind()
|
| | | {
|
| | | requireRemind = false;
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | var funcOpen = FuncOpen.Instance.IsFuncOpen(82);
|
| | | foreach (var skill in treasureSkills.Values)
|
| | | {
|
| | | var error = 0;
|
| | | if (requireRemind && funcOpen &&
|
| | | TryLevelUpTreasureSkill(skill.skillId, out error))
|
| | | {
|
| | | skill.levelUpRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | skill.levelUpRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | foreach (var potential in skill.potentials)
|
| | | {
|
| | | if (requireRemind && funcOpen &&
|
| | | TryLevelUpPotential(potential.id, out error))
|
| | | {
|
| | | potential.levelUpRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | potential.levelUpRedpoint.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public class TreasureSkill
|
| | | {
|
| | | public readonly int skillId;
|
| | | public readonly int maxLevel;
|
| | |
|
| | | public int level { get; private set; }
|
| | | public Redpoint redpoint { get; private set; }
|
| | | public Redpoint levelUpRedpoint { get; private set; }
|
| | | public List<TreasurePotential> potentials { get; private set; }
|
| | |
|
| | | public TreasureSkill(int skillId, int redpointIndex)
|
| | | {
|
| | | this.skillId = skillId;
|
| | | potentials = new List<TreasurePotential>();
|
| | |
|
| | | var config = SkillConfig.Get(skillId);
|
| | | maxLevel = config.SkillMaxLV;
|
| | |
|
| | | redpoint = new Redpoint(10304,
|
| | | TreasureSkillModel.REDPOINTID_BASE + redpointIndex);
|
| | | levelUpRedpoint = new Redpoint(redpoint.id,
|
| | | TreasureSkillModel.REDPOINTID_BASE + TreasureSkillModel.redpointIndex++);
|
| | | }
|
| | |
|
| | | public SkillConfig GetSkillConfig(int level)
|
| | | {
|
| | | if (level > 0)
|
| | | {
|
| | | return SkillConfig.Get(skillId + level - 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | return SkillConfig.Get(skillId + level);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Refresh(int newSkillId)
|
| | | {
|
| | | var config = SkillConfig.Get(newSkillId);
|
| | | if (config.SkillTypeID == skillId)
|
| | | {
|
| | | level = config.SkillLV;
|
| | | }
|
| | | else
|
| | | {
|
| | | var index = potentials.FindIndex((x) =>
|
| | | {
|
| | | return x.id == config.SkillTypeID;
|
| | | });
|
| | | if (index != -1)
|
| | | {
|
| | | potentials[index].Refresh(newSkillId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void Reset()
|
| | | {
|
| | | level = 0;
|
| | | foreach (var potential in potentials)
|
| | | {
|
| | | potential.Reset();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public class TreasurePotential
|
| | | {
|
| | | public readonly int id;
|
| | | public readonly int openLevel;
|
| | | public readonly int maxLevel;
|
| | | public int level { get; private set; }
|
| | |
|
| | | public Redpoint levelUpRedpoint { get; private set; }
|
| | |
|
| | | public TreasurePotential(int id, int level, int openLevel, int redpointBase)
|
| | | {
|
| | | this.id = id;
|
| | | this.level = level;
|
| | | this.openLevel = openLevel;
|
| | |
|
| | | var config = SkillConfig.Get(id);
|
| | | maxLevel = config.SkillMaxLV;
|
| | |
|
| | | levelUpRedpoint = new Redpoint(redpointBase,
|
| | | TreasureSkillModel.REDPOINTID_BASE + TreasureSkillModel.redpointIndex++);
|
| | | }
|
| | |
|
| | | public SkillConfig GetSkillConfig(int level)
|
| | | {
|
| | | if (level > 0)
|
| | | {
|
| | | return SkillConfig.Get(id + level - 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | return SkillConfig.Get(id + level);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Refresh(int newSkillId)
|
| | | {
|
| | | var config = SkillConfig.Get(newSkillId);
|
| | | if (config.SkillTypeID == id)
|
| | | {
|
| | | level = config.SkillLV;
|
| | | }
|
| | | }
|
| | |
|
| | | public void Reset()
|
| | | {
|
| | | level = 0;
|
| | | }
|
| | | }
|
| | | } |
| | | |
copy from System/Treasure/TreasureCollectPanel.cs.meta
copy to System/Skill/TreasureSkillModel.cs.meta
| File was copied from System/Treasure/TreasureCollectPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cb964a5a91c90c478bba3d8a2c1f030 |
| | | timeCreated: 1507533761 |
| | | guid: 2bed671cea174f043ac4b86026dfd447 |
| | | timeCreated: 1550631448 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, February 20, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class TreasureSkillWin : Window
|
| | | {
|
| | | [SerializeField] ScrollerController m_Controller;
|
| | |
|
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] Text m_SkillLevel;
|
| | | [SerializeField] Text m_SkillCoolDown;
|
| | | [SerializeField] Transform m_ContainerNow;
|
| | | [SerializeField] Text m_SkillDescNow;
|
| | | [SerializeField] Transform m_ContainerNext;
|
| | | [SerializeField] Text m_SkillDescNext;
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Button m_GetWay;
|
| | | [SerializeField] Button m_LevelUp;
|
| | | [SerializeField] TreasurePotentialBehaviour[] m_TreasurePotentials;
|
| | |
|
| | | TreasureSkillModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); }
|
| | | }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Controller.OnRefreshCell += OnRefreshCell;
|
| | | m_LevelUp.AddListener(LevelUp);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | |
|
| | | model.treasureSkillRefresh += TreasureSkillRefresh;
|
| | | model.selectRefresh += SelectRefresh;
|
| | | model.skillLevelUpRefresh += SkillLevelUpRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.treasureSkillRefresh -= TreasureSkillRefresh;
|
| | | model.selectRefresh -= SelectRefresh;
|
| | | model.skillLevelUpRefresh -= SkillLevelUpRefresh;
|
| | | model.SetAlreadyRemind();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void Display()
|
| | | {
|
| | | DisplaySkills();
|
| | | DisplaySkillDetial();
|
| | | }
|
| | |
|
| | | private void DisplaySkills()
|
| | | {
|
| | | List<int> list;
|
| | | m_Controller.Refresh();
|
| | | if (model.TryGetSkills(out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, list[i]);
|
| | | }
|
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | void DisplaySkillDetial()
|
| | | {
|
| | | TreasureSkill skill;
|
| | | m_GetWay.RemoveAllListeners();
|
| | | if (model.TryGetSkill(model.selectSkill, out skill))
|
| | | {
|
| | | var config = SkillConfig.Get(skill.skillId + skill.level - 1);
|
| | | if (config == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | m_SkillName.text = config.SkillName;
|
| | | m_SkillLevel.text = Language.Get("TreasureSkillLevel", skill.level);
|
| | | m_SkillCoolDown.text = Language.Get("L1065", config.CoolDownTime / 1000);
|
| | |
|
| | | bool isMax = skill.level >= skill.maxLevel;
|
| | | m_ContainerNext.gameObject.SetActive(!isMax);
|
| | |
|
| | | m_SkillDescNow.text = config.Description;
|
| | | if (!isMax)
|
| | | {
|
| | | var nextSkillConfig = SkillConfig.Get(skill.skillId + skill.level);
|
| | | m_SkillDescNext.text = nextSkillConfig.Description;
|
| | | }
|
| | |
|
| | | m_Item.SetItem(config.ExAttr4, config.ExAttr5);
|
| | | m_GetWay.AddListener(() =>
|
| | | {
|
| | |
|
| | | });
|
| | |
|
| | | for (int i = 0; i < m_TreasurePotentials.Length; i++)
|
| | | {
|
| | | if (i < skill.potentials.Count)
|
| | | {
|
| | | m_TreasurePotentials[i].gameObject.SetActive(true);
|
| | | m_TreasurePotentials[i].Display(skill.potentials[i].id);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TreasurePotentials[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void LevelUp()
|
| | | {
|
| | | var error = 0;
|
| | | if (model.TryLevelUpTreasureSkill(model.selectSkill, out error))
|
| | | {
|
| | | var pak = new C0304_tagCAddSkillPoint();
|
| | | pak.SkillID = (ushort)model.selectSkill;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.DisplayLevelUpError(error);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var skillCell = cell as TreasureSkillCell;
|
| | | skillCell.Display(cell.index);
|
| | | }
|
| | |
|
| | | private void TreasureSkillRefresh(int skillId)
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | if (skillId == model.selectSkill)
|
| | | {
|
| | | DisplaySkillDetial();
|
| | | }
|
| | | }
|
| | |
|
| | | private void SelectRefresh()
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | DisplaySkillDetial();
|
| | | }
|
| | |
|
| | | private void SkillLevelUpRefresh(int id)
|
| | | {
|
| | | if (model.selectSkill == id)
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | DisplaySkillDetial();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from System/Treasure/TreasureCollectPanel.cs.meta
copy to System/Skill/TreasureSkillWin.cs.meta
| File was copied from System/Treasure/TreasureCollectPanel.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4cb964a5a91c90c478bba3d8a2c1f030 |
| | | timeCreated: 1507533761 |
| | | guid: 8023a2df1da730a48842b762feded6bc |
| | | timeCreated: 1550642738 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | Treasure treasure;
|
| | | if (model.TryGetTreasure(model.selectedTreasure, out treasure))
|
| | | {
|
| | | var skillConfig = SkillConfig.Get(treasure.unlockSkill);
|
| | | var skillConfig = SkillConfig.Get(treasure.skillId);
|
| | | if (skillConfig != null)
|
| | | {
|
| | | m_SkillIcon.SetSprite(skillConfig.IconName);
|
| | |
| | | if (treasure.treasureStages.Count > 0 &&
|
| | | treasure.treasureStages[0].unlockType == TreasureStageUnlock.Skill)
|
| | | {
|
| | | var _skillId = treasure.unlockSkill;
|
| | | var _skillId = treasure.skillId;
|
| | | var skillConfig = SkillConfig.Get(_skillId);
|
| | | m_AddedEffect.text = skillConfig.Description;
|
| | | }
|
| | |
| | | case FunctionUnlockType.TreasureSkill:
|
| | | Treasure _treaure;
|
| | | ModelCenter.Instance.GetModel<TreasureModel>().TryGetTreasure(m_Id, out _treaure);
|
| | | var _skillCfg = SkillConfig.Get(_treaure.unlockSkill);
|
| | | var _skillCfg = SkillConfig.Get(_treaure.skillId);
|
| | | m_FunctionIcon.SetSprite(_skillCfg.IconName);
|
| | | m_FunctionIcon.SetNativeSize();
|
| | | originalScale = 1f;
|
| | |
| | | Treasure treasure;
|
| | | if (model.TryGetTreasure(model.selectedTreasure, out treasure))
|
| | | {
|
| | | var skillId = treasure.unlockSkill;
|
| | | var skillId = treasure.skillId;
|
| | | var skillConfig = SkillConfig.Get(skillId);
|
| | | m_SkillIcon.SetSprite(skillConfig.IconName);
|
| | | m_SkillName.text = skillConfig.SkillName;
|
| | |
| | | //m_Click.interactable = own >= need;
|
| | | m_AddBtnText.color = own >= need ? UIHelper.GetUIColor(TextColType.NavyBrown) : UIHelper.GetUIColor(TextColType.White);
|
| | | //m_Click.image.material = own >= need ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | | var config = TreasureSkillConfig.Get(potentialBook.levelUpId);
|
| | | var upRate = potentialBook.successRate - config.InitialRate;
|
| | | m_SuccessRatio.text = Language.Get("HallowsWin_UpSuccess", StringUtility.Contact((upRate * 0.01f).ToString("f0"), "%"));
|
| | | //var config = TreasureSkillConfig.Get(potentialBook.levelUpId);
|
| | | //var upRate = potentialBook.successRate - config.InitialRate;
|
| | | //m_SuccessRatio.text = Language.Get("HallowsWin_UpSuccess", StringUtility.Contact((upRate * 0.01f).ToString("f0"), "%"));
|
| | | }
|
| | |
|
| | | private void SelectPotentialBook()
|
| | |
| | | var progress = 0f;
|
| | | try
|
| | | {
|
| | | progress = treasure.progress / (float)treasure.achievements.Count;
|
| | | progress = treasure.progress / (float)config.RequirementTotal;
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | |
| | | Treasure treasure;
|
| | | if (model.TryGetTreasure(displayTreasureId, out treasure))
|
| | | {
|
| | | if (!treasure.hasClickChallenge)
|
| | | if (!treasure.alreadyClickChallenge)
|
| | | {
|
| | | var sendInfo = new CA516_tagCMMagicWeaponState();
|
| | | sendInfo.MWID = (uint)displayTreasureId;
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | |
|
| | | treasure.hasClickChallenge = true;
|
| | | treasure.alreadyClickChallenge = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | public int id { get; private set; }
|
| | |
|
| | | int m_Stage;
|
| | | public int stage
|
| | | {
|
| | | get { return m_Stage; }
|
| | | private set { m_Stage = value; }
|
| | | }
|
| | | public int stage { get; private set; }
|
| | |
|
| | | public int exp { get; private set; }
|
| | |
|
| | | bool m_HasClickChallenge = false;
|
| | | public bool hasClickChallenge
|
| | | {
|
| | | get { return m_HasClickChallenge; }
|
| | | set { m_HasClickChallenge = value; }
|
| | | }
|
| | | public bool alreadyClickChallenge { get; set; }
|
| | |
|
| | | TreasureState m_State = TreasureState.Locked;
|
| | | public TreasureState state
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public int unlockSkill
|
| | | public int skillId
|
| | | {
|
| | | get
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public List<TreasureStage> treasureStages = new List<TreasureStage>();
|
| | |
|
| | | public List<int> achievements = new List<int>();
|
| | | public Dictionary<int, AchievementGroup> achievementGroups = new Dictionary<int, AchievementGroup>();
|
| | |
|
| | | public Redpoint achievementRedpoint { get; private set; }
|
| | |
|
| | | public Treasure(int _id, int[] _potentialIds, Redpoint _skillLevelUpRedpoint, Redpoint _achievementPoint)
|
| | | public Treasure(int _id)
|
| | | {
|
| | | this.id = _id;
|
| | | this.achievementRedpoint = _achievementPoint;
|
| | |
|
| | | var config = TreasureConfig.Get(this.id);
|
| | | List<int> _expAchievements;
|
| | | if (SuccessConfig.TryGetTreasureExpAchievements(_id, out _expAchievements))
|
| | | {
|
| | | achievements.AddRange(_expAchievements);
|
| | | }
|
| | |
|
| | | foreach (var achievement in achievements)
|
| | | {
|
| | | var achievementConfig = SuccessConfig.Get(achievement);
|
| | |
|
| | | AchievementGroup group;
|
| | | if (achievementGroups.ContainsKey(achievementConfig.Group))
|
| | | {
|
| | | group = achievementGroups[achievementConfig.Group];
|
| | | }
|
| | | else
|
| | | {
|
| | | achievementGroups[achievementConfig.Group] = group = new AchievementGroup(achievementConfig.Group);
|
| | | }
|
| | |
|
| | | group.AddAchievement(achievement);
|
| | | }
|
| | |
|
| | | foreach (var group in achievementGroups.Values)
|
| | | {
|
| | | group.Sort();
|
| | | }
|
| | | }
|
| | | public AchievementGroup FindAchievementGroup(int _achievementId)
|
| | | {
|
| | | foreach (var key in achievementGroups.Keys)
|
| | | {
|
| | | var achievementGroup = achievementGroups[key];
|
| | | if (achievementGroup.Contain(_achievementId))
|
| | | {
|
| | | return achievementGroup;
|
| | | }
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | private int AchievementCompare(int _lhs, int _rhs)
|
| | | public void RefreshLevel(int stage, int exp, bool alreadyClickChallenge)
|
| | | {
|
| | | var configA = SuccessConfig.Get(_lhs);
|
| | | var configB = SuccessConfig.Get(_rhs);
|
| | |
|
| | | return configA.ReOrder < configB.ReOrder ? -1 : 1;
|
| | | }
|
| | |
|
| | | public void ParseTreasureStage(TreasureUpConfig config)
|
| | | {
|
| | | TreasureStage _stage = new TreasureStage(config);
|
| | | treasureStages.Add(_stage);
|
| | | }
|
| | |
|
| | | public void UpdateTreasureLevelExp(int level, int exp, bool _hasClickChallenge)
|
| | | {
|
| | | stage = level;
|
| | | this.stage = stage;
|
| | | this.exp = exp;
|
| | | hasClickChallenge = _hasClickChallenge;
|
| | | this.alreadyClickChallenge = alreadyClickChallenge;
|
| | | }
|
| | |
|
| | | public void AddTreasureStage(TreasureUpConfig config)
|
| | | {
|
| | | var _stage = new TreasureStage(config);
|
| | | treasureStages.Add(_stage);
|
| | | }
|
| | |
|
| | | public int GetStageId(int _stageIndex)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class TreasurePotential
|
| | | {
|
| | | public int id { get; private set; }
|
| | | public int level { get; set; }
|
| | |
|
| | | public TreasurePotential(int _id, int _level)
|
| | | {
|
| | | this.id = _id;
|
| | | this.level = _level;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct PotentialBook
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | var skillConfig = SkillConfig.Get(m_Treasure.unlockSkill);
|
| | | var skillConfig = SkillConfig.Get(m_Treasure.skillId);
|
| | | m_ContainerSkill.gameObject.SetActive(skillConfig != null);
|
| | | if (skillConfig != null)
|
| | | {
|
| | |
| | | { |
| | | var config = TreasureConfig.Get(m_Treasure.id); |
| | | m_FunctionTitle.text = Language.Get("Hallows_UnLockSkill"); |
| | | var skillConfig = SkillConfig.Get(m_Treasure.unlockSkill); |
| | | var skillConfig = SkillConfig.Get(m_Treasure.skillId); |
| | | m_FunctionName.text = skillConfig.SkillName; |
| | | m_Icon.SetSprite(skillConfig.IconName); |
| | | |
| | |
| | | foreach (var treasure in treasures.Values)
|
| | | {
|
| | | treasure.state = TreasureState.Locked;
|
| | | treasure.UpdateTreasureLevelExp(0, 0, false);
|
| | | treasure.RefreshLevel(0, 0, false);
|
| | | }
|
| | | foreach (var treasureDungeon in treasureDungeons.Values)
|
| | | {
|
| | |
| | | {
|
| | | int[] achievements = null;
|
| | | var config = TreasureConfig.Get(treasure.id);
|
| | | if ((TreasureCategory)config.Category == TreasureCategory.Human)
|
| | | {
|
| | | achievements = treasure.achievements.ToArray();
|
| | | }
|
| | | else
|
| | | {
|
| | | achievements = config.Achievements;
|
| | | }
|
| | | achievements = config.Achievements;
|
| | | if (achievements == null)
|
| | | {
|
| | | return;
|
| | | continue;
|
| | | }
|
| | | if (Array.IndexOf(achievements, _achievement) != -1)
|
| | | {
|
| | |
| | | var oldProgress = _treasure.progress;
|
| | | var tempProgress = 0;
|
| | | Achievement achievement;
|
| | | //if (achievementModel.TryGetAchievement(config.MainID, out achievement))
|
| | | //{
|
| | | // if (achievement.completed)
|
| | | // {
|
| | | // tempProgress++;
|
| | | // }
|
| | | //}
|
| | |
|
| | | int[] achievements = config.Achievements;
|
| | | if ((TreasureCategory)config.Category == TreasureCategory.Human)
|
| | | {
|
| | | achievements = _treasure.achievements.ToArray();
|
| | | }
|
| | | else
|
| | | {
|
| | | achievements = config.Achievements;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < achievements.Length; i++)
|
| | | {
|
| | |
| | | foreach (var treasure in treasures.Values)
|
| | | {
|
| | | var config = TreasureConfig.Get(treasure.id);
|
| | | if (treasure.achievements.Contains(_achievementId))
|
| | | var achievements = config.Achievements;
|
| | | if (achievements != null)
|
| | | {
|
| | | UpdateTreasureCollectProgress(treasure);
|
| | | if (Array.IndexOf(achievements, _achievementId) != -1)
|
| | | {
|
| | | UpdateTreasureCollectProgress(treasure);
|
| | | }
|
| | | }
|
| | |
|
| | | if (treasure.state == TreasureState.Locked)
|
| | |
| | | {
|
| | | _up = true;
|
| | | }
|
| | | treasure.UpdateTreasureLevelExp(package.InfoList[i].LV, (int)package.InfoList[i].Exp, package.InfoList[i].State == 1);
|
| | | treasure.RefreshLevel(package.InfoList[i].LV, (int)package.InfoList[i].Exp, package.InfoList[i].State == 1);
|
| | | if (treasureLevelProgressUpdateEvent != null)
|
| | | {
|
| | | treasureLevelProgressUpdateEvent(treasure.id);
|
| | |
| | | }
|
| | |
|
| | | categoryTreasures.Add(config.ID);
|
| | | var skillLevelUpRedpoint = config.Potentials.Length > 0 ? new Redpoint(CATEGORY_REDPOINTIDS[config.Category - 1], TREASURE_REDPOINTBASE + redpointIndex++) : null;
|
| | | var achievementRedpoint = new Redpoint(CATEGORY_REDPOINTIDS[config.Category - 1], TREASURE_REDPOINTBASE + redpointIndex++);
|
| | | Treasure treasure;
|
| | | if (category == TreasureCategory.Human)
|
| | | {
|
| | | treasure = new Treasure(config.ID, config.Potentials, skillLevelUpRedpoint, achievementRedpoint);
|
| | | }
|
| | | else
|
| | | {
|
| | | treasure = new Treasure(config.ID, config.Potentials, skillLevelUpRedpoint, achievementRedpoint);
|
| | | }
|
| | | Treasure treasure = new Treasure(config.ID);
|
| | |
|
| | | treasures[config.ID] = treasure;
|
| | |
|
| | |
| | | Treasure treasure;
|
| | | if (TryGetTreasure(config.MWID, out treasure))
|
| | | {
|
| | | treasure.ParseTreasureStage(config);
|
| | | treasure.AddTreasureStage(config);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | Treasure treasure;
|
| | | if (TryGetTreasure(list[i], out treasure)
|
| | | && treasure.unlockSkill == skillId)
|
| | | && treasure.skillId == skillId)
|
| | | {
|
| | | return list[i];
|
| | | }
|
| | |
| | | case JumpUIType.SkillFunc2:
|
| | | case JumpUIType.SkillFunc3:
|
| | | case JumpUIType.SkillFunc2Type2:
|
| | | SetJumpLogic<SkillPanel>(_tagWinSearchModel.TABID);
|
| | | SetJumpLogic<SkillWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.StrengthFunc1:
|
| | | case JumpUIType.StrengthFunc2:
|
| | |
| | | if (_treasure != null)
|
| | | {
|
| | | m_HeroSkillCompletet = callback;
|
| | | var _skillId = _treasure.unlockSkill;
|
| | | var _skillId = _treasure.skillId;
|
| | | var _index = m_TreasureSkills.FindIndex((x) =>
|
| | | {
|
| | | return x.treasureId == _treasureId;
|