diff --git a/Assets/Scripts/Utils/Utils.cs b/Assets/Scripts/Utils/Utils.cs index 3ec993367..5538be6bf 100644 --- a/Assets/Scripts/Utils/Utils.cs +++ b/Assets/Scripts/Utils/Utils.cs @@ -7,6 +7,9 @@ using UnityEngine.UI; using System.Net.NetworkInformation; using System.Net.Sockets; using System.IO; +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; namespace BF { @@ -252,6 +255,13 @@ namespace BF return Convert.ToInt64(result); } + public static TweenerCore DOBFSliderValue(BFSlider target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.value, x => target.value = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + // 从Sha1证书签名中提取keyhash给facebook等sdk用 // 需要去GooglePlayConsle后台查看证书的sha1 public static string GetAndroidSignKeyHash() diff --git a/Assets/XLua/Gen/BF_UtilsWrap.cs b/Assets/XLua/Gen/BF_UtilsWrap.cs index 773eda165..473bdaab6 100644 --- a/Assets/XLua/Gen/BF_UtilsWrap.cs +++ b/Assets/XLua/Gen/BF_UtilsWrap.cs @@ -31,7 +31,7 @@ namespace XLua.CSObjectWrap Utils.EndObjectRegister(type, L, translator, null, null, null, null, null); - Utils.BeginClassRegister(type, L, __CreateInstance, 25, 0, 0); + Utils.BeginClassRegister(type, L, __CreateInstance, 26, 0, 0); Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFreeChar", _m_GetFreeChar_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "GetConfigChar", _m_GetConfigChar_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "IsNull", _m_IsNull_xlua_st_); @@ -54,6 +54,7 @@ namespace XLua.CSObjectWrap Utils.RegisterFunc(L, Utils.CLS_IDX, "GetEnvironmentTickCount", _m_GetEnvironmentTickCount_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "GetDataSecretKey", _m_GetDataSecretKey_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "GetRewardNumber", _m_GetRewardNumber_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "DOBFSliderValue", _m_DOBFSliderValue_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "GetAndroidSignKeyHash", _m_GetAndroidSignKeyHash_xlua_st_); @@ -696,6 +697,53 @@ namespace XLua.CSObjectWrap } + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_DOBFSliderValue_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 4&& translator.Assignable(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)) + { + BF.BFSlider _target = (BF.BFSlider)translator.GetObject(L, 1, typeof(BF.BFSlider)); + float _endValue = (float)LuaAPI.lua_tonumber(L, 2); + float _duration = (float)LuaAPI.lua_tonumber(L, 3); + bool _snapping = LuaAPI.lua_toboolean(L, 4); + + var gen_ret = BF.Utils.DOBFSliderValue( _target, _endValue, _duration, _snapping ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 3&& translator.Assignable(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) + { + BF.BFSlider _target = (BF.BFSlider)translator.GetObject(L, 1, typeof(BF.BFSlider)); + float _endValue = (float)LuaAPI.lua_tonumber(L, 2); + float _duration = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = BF.Utils.DOBFSliderValue( _target, _endValue, _duration ); + 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 BF.Utils.DOBFSliderValue!"); + + } + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_GetAndroidSignKeyHash_xlua_st_(RealStatePtr L) { diff --git a/Assets/lua/app/global/global_func.lua.bytes b/Assets/lua/app/global/global_func.lua.bytes index e979c1edb..62652ecc7 100644 Binary files a/Assets/lua/app/global/global_func.lua.bytes and b/Assets/lua/app/global/global_func.lua.bytes differ diff --git a/Assets/lua/app/module/battle/component/battle_unit_comp.lua.bytes b/Assets/lua/app/module/battle/component/battle_unit_comp.lua.bytes index 3dac5ade7..3f99af52d 100644 Binary files a/Assets/lua/app/module/battle/component/battle_unit_comp.lua.bytes and b/Assets/lua/app/module/battle/component/battle_unit_comp.lua.bytes differ diff --git a/Assets/lua/app/module/battle/controller/battle_controller.lua.bytes b/Assets/lua/app/module/battle/controller/battle_controller.lua.bytes index f7de22fb5..9c5cfc4e6 100644 Binary files a/Assets/lua/app/module/battle/controller/battle_controller.lua.bytes and b/Assets/lua/app/module/battle/controller/battle_controller.lua.bytes differ diff --git a/Assets/lua/app/module/battle/helper/battle_helper.lua.bytes b/Assets/lua/app/module/battle/helper/battle_helper.lua.bytes index 3da628a75..dc48b1b9b 100644 Binary files a/Assets/lua/app/module/battle/helper/battle_helper.lua.bytes and b/Assets/lua/app/module/battle/helper/battle_helper.lua.bytes differ diff --git a/Assets/lua/app/module/battle/helper/battle_passive.lua.bytes b/Assets/lua/app/module/battle/helper/battle_passive.lua.bytes index 91464eabf..565bae400 100644 Binary files a/Assets/lua/app/module/battle/helper/battle_passive.lua.bytes and b/Assets/lua/app/module/battle/helper/battle_passive.lua.bytes differ diff --git a/Assets/lua/app/module/battle/team/battle_team.lua.bytes b/Assets/lua/app/module/battle/team/battle_team.lua.bytes index 423f431f0..74617265b 100644 Binary files a/Assets/lua/app/module/battle/team/battle_team.lua.bytes and b/Assets/lua/app/module/battle/team/battle_team.lua.bytes differ diff --git a/Assets/lua/app/ui/battle/battle_ui.lua.bytes b/Assets/lua/app/ui/battle/battle_ui.lua.bytes index f984e0691..e6c9e8101 100644 Binary files a/Assets/lua/app/ui/battle/battle_ui.lua.bytes and b/Assets/lua/app/ui/battle/battle_ui.lua.bytes differ diff --git a/Assets/lua/app/userdata/battle/team/battle_team_entity.lua.bytes b/Assets/lua/app/userdata/battle/team/battle_team_entity.lua.bytes index 8633e770b..1682e369c 100644 Binary files a/Assets/lua/app/userdata/battle/team/battle_team_entity.lua.bytes and b/Assets/lua/app/userdata/battle/team/battle_team_entity.lua.bytes differ diff --git a/Assets/lua/app/userdata/battle/team/battle_unit_entity.lua.bytes b/Assets/lua/app/userdata/battle/team/battle_unit_entity.lua.bytes index 2774ad78e..9d28863b9 100644 Binary files a/Assets/lua/app/userdata/battle/team/battle_unit_entity.lua.bytes and b/Assets/lua/app/userdata/battle/team/battle_unit_entity.lua.bytes differ