zoukankan      html  css  js  c++  java
  • Unity热更新03-C#调用XLua-09-Lua表映射到 XLua的LuaTable中(不建议)

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using XLua;
    
    public class Lesson9_CallLuaTable : MonoBehaviour
    {
        void Start()
        {
            LuaMgr.GetInstance().Init();
            LuaMgr.GetInstance().DoLuaFile("Main");
    
            //不建议使用LuaTable和LuaFunction 效率低
            //引用对象
            LuaTable table = LuaMgr.GetInstance().Global.Get<LuaTable>("testClas");
            Debug.Log(table.Get<int>("testInt"));
            Debug.Log(table.Get<bool>("testBool"));
            Debug.Log(table.Get<float>("testFloat"));
            Debug.Log(table.Get<string>("testString"));
    
            table.Get<LuaFunction>("testFun").Call();
            //改  引用
            table.Set("testInt", 55);
            Debug.Log(table.Get<int>("testInt"));
            LuaTable table2 = LuaMgr.GetInstance().Global.Get<LuaTable>("testClas");
            Debug.Log(table2.Get<int>("testInt"));
    
            table.Dispose();
            table2.Dispose();
        }
    }
    
    
  • 相关阅读:
    2015多校1006.First One
    2015多校.MZL's endless loop(欧拉回路的机智应用 || 构造)
    LUXURY 8
    矩阵快速幂模板
    博弈入门
    cf558c(bfs)
    LUXURY 7
    dfs序 + RMQ = LCA
    双端队列
    UVa-401 Palindromes
  • 原文地址:https://www.cnblogs.com/unitysir/p/13891025.html
Copyright © 2011-2022 走看看