Exemplo n.º 1
0
    void CreateTexForItem(Texture2D tex, string name)
    {
        var newtex     = rtt.AdjustTex(tex, 0, 0, 1); //纹理需要在Y轴镜像一下
        var webtexdata = newtex.GetPixels32();
        var tex_handle = GCHandle.Alloc(webtexdata, GCHandleType.Pinned);
        var p_tex_ptr  = tex_handle.AddrOfPinnedObject();

        rtt.CreateTexForItem((int)SlotForItems.Makeup, name, p_tex_ptr, newtex.width, newtex.height);
        tex_handle.Free();
    }