/// <summary> /// 播放叠影抖动效果 /// </summary> /// <returns>The double image shake.</returns> /// <param name="duration">Duration.</param> /// <param name="callback">Callback.</param> /// <param name="x">The x coordinate.</param> /// <param name="y">The y coordinate.</param> /// <param name="interval">Interval.</param> /// <param name="cam">Cam.</param> public static DoubleImageShake PlayDoubleImageShake(float duration, LuaFunction callback = null, float x = 35f, float y = 10f, float interval = 0.045f, Camera cam = null) { if (cam == null) { cam = Camera.main; } DoubleImageShake dis = (DoubleImageShake)AddOrGetComponent(cam.gameObject, typeof(DoubleImageShake)); if (dis.shader == null) { dis.shader = (Shader)ResManager.LoadAsset("Shaders/PostEffect/DoubleImageShake.shader", Stage.currentSceneName); } Action action = null; if (callback != null) { action = () => { callback.BeginPCall(); callback.Call(); callback.EndPCall(); } } ; dis.Play(duration, action, x, y, interval); return(dis); }
static int Play(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { ShibaInu.DoubleImageShake obj = (ShibaInu.DoubleImageShake)ToLua.CheckObject <ShibaInu.DoubleImageShake>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.Play(arg0); return(0); } else if (count == 3) { ShibaInu.DoubleImageShake obj = (ShibaInu.DoubleImageShake)ToLua.CheckObject <ShibaInu.DoubleImageShake>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); System.Action arg1 = (System.Action)ToLua.CheckDelegate <System.Action>(L, 3); obj.Play(arg0, arg1); return(0); } else if (count == 4) { ShibaInu.DoubleImageShake obj = (ShibaInu.DoubleImageShake)ToLua.CheckObject <ShibaInu.DoubleImageShake>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); System.Action arg1 = (System.Action)ToLua.CheckDelegate <System.Action>(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); obj.Play(arg0, arg1, arg2); return(0); } else if (count == 5) { ShibaInu.DoubleImageShake obj = (ShibaInu.DoubleImageShake)ToLua.CheckObject <ShibaInu.DoubleImageShake>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); System.Action arg1 = (System.Action)ToLua.CheckDelegate <System.Action>(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); float arg3 = (float)LuaDLL.luaL_checknumber(L, 5); obj.Play(arg0, arg1, arg2, arg3); return(0); } else if (count == 6) { ShibaInu.DoubleImageShake obj = (ShibaInu.DoubleImageShake)ToLua.CheckObject <ShibaInu.DoubleImageShake>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); System.Action arg1 = (System.Action)ToLua.CheckDelegate <System.Action>(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); float arg3 = (float)LuaDLL.luaL_checknumber(L, 5); float arg4 = (float)LuaDLL.luaL_checknumber(L, 6); obj.Play(arg0, arg1, arg2, arg3, arg4); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: ShibaInu.DoubleImageShake.Play")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }