示例#1
0
        public void Push(IntPtr L, Transform o)
        {
            if (o == null)
            {
                LuaDLL.lua_pushnil(L);
            }
            else
            {
                Type type      = o.GetType();
                int  reference = -1;

                if (type == typeof(Transform))
                {
                    reference = TypeTraits <Transform> .GetLuaReference(L);
                }
                else
                {
                    reference = LuaStatic.GetMetaReference(L, type);
                }

                if (reference <= 0)
                {
                    reference = ToLua.LoadPreType(L, type);
                }

                ToLua.PushUserData(L, o, reference);
            }
        }
示例#2
0
        public void Push(IntPtr L, GameObject o)
        {
            if (o == null)
            {
                LuaDLL.lua_pushnil(L);
            }
            else
            {
                int reference = TypeTraits <GameObject> .GetLuaReference(L);

                if (reference <= 0)
                {
                    reference = ToLua.LoadPreType(L, typeof(GameObject));
                }

                ToLua.PushUserData(L, o, reference);
            }
        }