コード例 #1
0
    static int GetType(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(NTGApplicationController)))
            {
                NTGApplicationController obj = (NTGApplicationController)ToLua.ToObject(L, 1);
                System.Type o = obj.GetType();
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(string)))
            {
                string      arg0 = ToLua.ToString(L, 1);
                System.Type o    = NTGApplicationController.GetType(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: NTGApplicationController.GetType"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
        private IEnumerator doLoadAsset()
        {
            abname = abname.ToLower();
            yield return(rc.StartCoroutine(LoadAssetBundle(abname)));

            if (string.IsNullOrEmpty(assettype))
            {
                var r = bundle.LoadAssetAsync <GameObject>(assetname);
                while (!r.isDone)
                {
                    yield return(new WaitForSeconds(0.05f));
                }
                Asset = r.asset;
            }
            else
            {
                var r = bundle.LoadAssetAsync(assetname, NTGApplicationController.GetType(assettype));
                while (!r.isDone)
                {
                    yield return(new WaitForSeconds(0.05f));
                }
                Asset = r.asset;
            }
            Done = true;
        }
コード例 #3
0
 static int SetShowQuality(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         bool arg0 = LuaDLL.luaL_checkboolean(L, 1);
         NTGApplicationController.SetShowQuality(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #4
0
 static int LuaReleaseTable(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGApplicationController obj = (NTGApplicationController)ToLua.CheckObject(L, 1, typeof(NTGApplicationController));
         LuaTable arg0 = ToLua.CheckLuaTable(L, 2);
         obj.LuaReleaseTable(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #5
0
 static int RemoveTableCache(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGApplicationController obj = (NTGApplicationController)ToLua.CheckObject(L, 1, typeof(NTGApplicationController));
         string arg0 = ToLua.CheckString(L, 2);
         obj.RemoveTableCache(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #6
0
 static int LuaDoFile(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGApplicationController obj = (NTGApplicationController)ToLua.CheckObject(L, 1, typeof(NTGApplicationController));
         string   arg0 = ToLua.CheckString(L, 2);
         object[] o    = obj.LuaDoFile(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #7
0
    public UnityEngine.Object LoadAsset(string abname, string assetname, string assettype)
    {
        if (DebugLevel > 1)
        {
            Debug.LogWarning("LoadAsset " + abname + " " + assetname);
        }

        abname = abname.ToLower();
        AssetBundle bundle = LoadAssetBundle(abname);

        //return (UnityEngine.Object) typeof (AssetBundle).GetMethods(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance)
        //    .Single(x => x.Name == "LoadAsset" && x.IsGenericMethod &&
        //                 x.GetParameters().Length == 1 && x.GetParameters()[0].ParameterType == typeof (string))
        //    .MakeGenericMethod(LuaScriptMgr.GetType(assettype)).Invoke(bundle, new object[] {assetname});
        return(bundle.LoadAsset(assetname, NTGApplicationController.GetType(assettype)));
    }
コード例 #8
0
    static int set_standaloneInputModule(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGApplicationController obj = (NTGApplicationController)o;
            UnityEngine.EventSystems.StandaloneInputModule arg0 = (UnityEngine.EventSystems.StandaloneInputModule)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.EventSystems.StandaloneInputModule));
            obj.standaloneInputModule = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index standaloneInputModule on a nil value" : e.Message));
        }
    }
コード例 #9
0
    static int set_gameRoot(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGApplicationController obj  = (NTGApplicationController)o;
            UnityEngine.Transform    arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform));
            obj.gameRoot = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index gameRoot on a nil value" : e.Message));
        }
    }
コード例 #10
0
    static int set_Initialized(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGApplicationController obj = (NTGApplicationController)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.Initialized = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Initialized on a nil value" : e.Message));
        }
    }
コード例 #11
0
    static int get_gameRoot(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGApplicationController obj = (NTGApplicationController)o;
            UnityEngine.Transform    ret = obj.gameRoot;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index gameRoot on a nil value" : e.Message));
        }
    }
コード例 #12
0
    static int get_Initialized(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGApplicationController obj = (NTGApplicationController)o;
            bool ret = obj.Initialized;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Initialized on a nil value" : e.Message));
        }
    }
コード例 #13
0
 static int LuaGetFunction(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         NTGApplicationController obj = (NTGApplicationController)ToLua.CheckObject(L, 1, typeof(NTGApplicationController));
         string arg0 = ToLua.CheckString(L, 2);
         string arg1 = ToLua.CheckString(L, 3);
         LuaInterface.LuaFunction o = obj.LuaGetFunction(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #14
0
    static int get_standaloneInputModule(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGApplicationController obj = (NTGApplicationController)o;
            UnityEngine.EventSystems.StandaloneInputModule ret = obj.standaloneInputModule;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index standaloneInputModule on a nil value" : e.Message));
        }
    }
コード例 #15
0
 static int LuaCall(IntPtr L)
 {
     try
     {
         int count = LuaDLL.lua_gettop(L);
         NTGApplicationController obj = (NTGApplicationController)ToLua.CheckObject(L, 1, typeof(NTGApplicationController));
         string   arg0 = ToLua.CheckString(L, 2);
         string   arg1 = ToLua.CheckString(L, 3);
         object[] arg2 = ToLua.ToParamsObject(L, 4, count - 3);
         object[] o    = obj.LuaCall(arg0, arg1, arg2);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #16
0
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
            DontDestroyOnLoad(gameObject);

            Application.targetFrameRate = NTGApplicationConfig.ApplicationTargetFPS;
            Screen.sleepTimeout         = SleepTimeout.NeverSleep;

            if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
            {
                Destroy(standaloneInputModule);
            }

            InitResources();
        }
        else
        {
            DestroyImmediate(gameObject);
        }
    }
コード例 #17
0
 public static Type GetType(string TypeName)
 {
     return(NTGApplicationController.GetType(TypeName));
 }