当前位置: 首页 > news >正文

公司旅游视频网站模板免费下载wordpress列表分页代码

公司旅游视频网站模板免费下载,wordpress列表分页代码,招商网站搭建费用,wordpress页面大小修改上一篇文章中我使用UnrealSharp成功使用了我的一个C#控制台程序中的网络模块#xff0c;这个程序是基于KCP网络了#xff0c;其中调用了Cmake 编译的一个C的DLL#xff0c;在虚幻中DLL需要放在Binaries目录中才可以。Unity中只要放在任意Plugins目录中就可以。 但是Binaries…上一篇文章中我使用UnrealSharp成功使用了我的一个C#控制台程序中的网络模块这个程序是基于KCP网络了其中调用了Cmake 编译的一个C的DLL在虚幻中DLL需要放在Binaries目录中才可以。Unity中只要放在任意Plugins目录中就可以。 但是Binaries目录版本控制一般不提交我们可以改一下改成按照路径加载。 修改前的脚本 using System.Runtime.InteropServices;//脚本修改自//https://github.com/a11s/kcp_warppernamespace NetLibrary {public unsafe class KCP{const string LIBNAME libikcp.dll;//---------------------------------------------------------------------// interface//---------------------------------------------------------------------/// summary/// create a new kcp control object, conv must equal in two endpoint/// from the same connection. user will be passed to the output callback/// output callback can be setup like this: kcp-output my_udp_output/// /summary/// param nameconv/param/// param nameuser/param/// returns/returns[DllImport(LIBNAME, EntryPoint ikcp_create, CallingConvention CallingConvention.Cdecl)]public static extern IKCPCB* ikcp_create(uint conv, void* user);/// summary/// release kcp control object/// /summary/// param namekcp/param[DllImport(LIBNAME, EntryPoint ikcp_release, CallingConvention CallingConvention.Cdecl)]public static extern void ikcp_release(IKCPCB* kcp);/// summary/// set output callback, which will be invoked by kcp///public static extern void ikcp_setoutput(IKCPCB* kcp, int (* output)(byte* buf, int len, ikcpcb *kcp, void* user));/// /summary/// param namekcp/param/// param named_output/param[DllImport(LIBNAME, EntryPoint ikcp_setoutput, CallingConvention CallingConvention.Cdecl)]public static extern void ikcp_setoutput(IKCPCB* kcp, System.IntPtr d_output); 篇幅太大没有必要只展示部分代码片段。 可以看到之前是通过DllImport 载入LIBNAME变量来载入DLL的。 改为动态路径 先放上所有改动 // 动态获取库路径 private static string GetLibraryPath() {string baseDirectory AppDomain.CurrentDomain.BaseDirectory;//动态库的路径被拼接到 Binaries\Managed\Third\libikcp.dll而你的实际库文件存放在 E:\myproject\Third\libikcp.dll这说明 AppDomain.CurrentDomain.BaseDirectory 返回的路径是 Binaries\Managed。baseDirectory Path.Combine(baseDirectory, ../../);string relativePath;// 根据平台选择库路径if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)){relativePath ThirdParty/Kcp/Win64/libikcp.dll;}else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create(ANDROID))){relativePath ThirdParty/Kcp/Android/arm64-v8a/libikcp.so;}else{throw new PlatformNotSupportedException(Unsupported platform);}return Path.Combine(baseDirectory, relativePath); }// DllImport 使用动态路径 private const string LIBNAME PLACEHOLDER; // 占位符 private static bool _isResolverSet false; // 添加初始化方法以动态设置路径 public static void Initialize() {if (_isResolverSet){Loger.Debug($BSserver DLL: 已经加载过了 .);return;}try{string libraryPath GetLibraryPath();//Loger.Error($BSserver DLL:{libraryPath});NativeLibrary.SetDllImportResolver(typeof(KCP).Assembly, (name, assembly, path) {if (name LIBNAME){return NativeLibrary.Load(libraryPath);}return IntPtr.Zero;});_isResolverSet true;}catch(Exception e) {//AClientMain.inst.PrintString(C# : DLL: libraryPath);Console.WriteLine($Loaded library 加载错误 .e.Message);Loger.Error($BSserver DLL 加载错误 : e.Message);}} //const string LIBNAME libikcp.dll; //--------------------------------------------------------------------- // interface //---------------------------------------------------------------------/// summary /// create a new kcp control object, conv must equal in two endpoint /// from the same connection. user will be passed to the output callback /// output callback can be setup like this: kcp-output my_udp_output /// /summary /// param nameconv/param /// param nameuser/param /// returns/returns [DllImport(LIBNAME, EntryPoint ikcp_create, CallingConvention CallingConvention.Cdecl)] public static extern IKCPCB* ikcp_create(uint conv, void* user);/// summary /// release kcp control object /// /summary /// param namekcp/param [DllImport(LIBNAME, EntryPoint ikcp_release, CallingConvention CallingConvention.Cdecl)] public static extern void ikcp_release(IKCPCB* kcp);使用方法 我们在UE的工程下创建目录ThirdParty按照代码里的路径把DLL放进去按照不同平台。 在加载DLL之前我们需要调用Initialize方法初始化动态设置路径就可以了。 这些代码是ChatGPT帮忙写的经过几次修改有了这段代码。 小技巧 以前是内事不决问baidu外事不决问google现在是内事问豆包外事问ChatGPT。 但是小心AI一本正经的胡说八道。 P
http://www.hkea.cn/news/14528608/

相关文章:

  • 品牌网站设计企业服务企业网站建设公司电话西安
  • WordPress插件代码化科学新概念seo外链
  • 网站设计及建设合同平湖市网站建设
  • 天津外贸公司网站制作wordpress本地浏览慢
  • 河北建设集团园林网站网站推广公司
  • 网站手机客户端生成网站有图片的验证码是怎么做的
  • 苏州建设网站专业哈尔滨网站设计公司哪家更好
  • 小程序是什么时候出来的外贸seo优化
  • 网站建设思维平面设计师要学哪些软件
  • 咸鱼网站做链接wordpress自定义文章参数
  • 江苏省品牌专业建设网站上海市建设安全协会网站查询系统瘫
  • 建站宝盒怎么样公司企业策划书模板
  • 西宁网站制作 青wordpress yusi主题
  • 怎么做建设网站首页天津网站建设哪家好
  • 忻州建设厅官方网站设置 iis 网站维护中
  • 小说网站开发 项目计划书成都网站建设的定位
  • 中山seo排名优化seo网站建设技巧
  • 珠海专业的免费建站东莞高端网站定制
  • 如何使用阿里云建站长沙有哪些设计公司
  • 上海松江建设银行网站wordpress制作婚礼
  • 在哪里创建网站网页升级访问永久你懂的
  • 2 网站建设的一般步骤包含哪些网站静态和动态区别是什么意思
  • 外贸网站需要多少个语言百度运营公司
  • 外贸网站系统网站的手机站页面重复
  • 重庆建网站企业有哪些wordpress高端
  • 网站快速建设软件下载seo域名如何优化
  • 餐厅网站页面设计wordpress中主题页脚太高怎么办
  • 网站建设的基本概念网站欢迎页面在线设计
  • wengdo网站开发创意设计山东省聊城建设学校网站
  • 罗村网站建设邢台公司网站设计