Exemple #1
0
        static MediaMgr CreateInstance()
        {
            GameObject go  = GameMgr.Instance.gameObject;
            MediaMgr   mgr = new MediaMgr();

            mgr.m_MusicSource = go.AddComponent <AudioSource>();
            mgr.m_SoundSource = go.AddComponent <AudioSource>();
            return(mgr);
        }
 static int GetSoundVolume(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         WCG.MediaMgr obj = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         float        o   = obj.GetSoundVolume();
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetSoundVolume(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.MediaMgr obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         float        arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.SetSoundVolume(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetMusicPause(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.MediaMgr obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         bool         arg0 = LuaDLL.luaL_checkboolean(L, 2);
         obj.SetMusicPause(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int PlayMusic(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         WCG.MediaMgr obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         string       arg0 = ToLua.CheckString(L, 2);
         bool         arg1 = LuaDLL.luaL_checkboolean(L, 3);
         obj.PlayMusic(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetClipAsync(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         WCG.MediaMgr obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         string       arg0 = ToLua.CheckString(L, 2);
         UnityEngine.Events.UnityAction <UnityEngine.Object> arg1 = (UnityEngine.Events.UnityAction <UnityEngine.Object>)ToLua.CheckDelegate <UnityEngine.Events.UnityAction <UnityEngine.Object> >(L, 3);
         obj.GetClipAsync(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetClip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         WCG.MediaMgr          obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         string                arg0 = ToLua.CheckString(L, 2);
         UnityEngine.AudioClip o    = obj.GetClip(arg0);
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_bSoundMute(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            WCG.MediaMgr obj  = (WCG.MediaMgr)o;
            bool         arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.bSoundMute = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bSoundMute on a nil value"));
        }
    }
    static int get_bSoundIsPlaying(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            WCG.MediaMgr obj = (WCG.MediaMgr)o;
            bool         ret = obj.bSoundIsPlaying;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bSoundIsPlaying on a nil value"));
        }
    }
 static int PlaySound(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         WCG.MediaMgr obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         string       arg0 = ToLua.CheckString(L, 2);
         bool         arg1 = LuaDLL.luaL_checkboolean(L, 3);
         float        o    = obj.PlaySound(arg0, arg1);
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int PlayVideo(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         WCG.MediaMgr obj  = (WCG.MediaMgr)ToLua.CheckObject <WCG.MediaMgr>(L, 1);
         string       arg0 = ToLua.CheckString(L, 2);
         bool         arg1 = LuaDLL.luaL_checkboolean(L, 3);
         LuaFunction  arg2 = ToLua.CheckLuaFunction(L, 4);
         bool         o    = obj.PlayVideo(arg0, arg1, arg2);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int _CreateWCG_MediaMgr(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                WCG.MediaMgr obj = new WCG.MediaMgr();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: WCG.MediaMgr.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }