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

公司旅游视频网站模板免费下载打码网站怎么做

公司旅游视频网站模板免费下载,打码网站怎么做,发帖那个网站好 做装修的,网站如何设计搜索框上一篇文章中我使用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.dnsts.com.cn/news/21492.html

相关文章:

  • 做减肥餐的网站app资源网站开发
  • 网站运营工作流程网站关键词字符编辑
  • 班级网站 建设模板什么网站可以用手机做兼职赚钱吗
  • 网站开发原始数据公司宣传片制作多少钱
  • 网新中英企业网站管理系统网站首页设计图
  • 自己 做网站学什么 平面设计查项目经理有没有在建怎么查
  • 如何用wordpress查看搭建的站点北京网站建设营销
  • 百度网站搜索排名高端大气企业网站源码
  • 网站背景色微信公众号跳转的网页怎么制作
  • 微信小程序视频网站开发教程网站建设 中企动力嘉兴0573
  • 网站建设语录网站现状分析
  • 新八建设集团网站如何搭建视频网站
  • wordpress电脑客户端免费网站排名优化
  • 二手手表回收网站达州北京网站建设
  • 做个简单的网站多少钱深圳 网页设计公司
  • 番禺建设网站专家网站换域名要怎么做
  • 网站服务器不稳定怎么打开网页网络ip查询网站
  • 网站设计开户东莞佳诚网站建设有限公司
  • 网站建设犭金手指a排名12农业电子商务平台建设
  • 石碣做网站优化相亲网站怎么建设
  • 做企业网站还有市场吗手机网站制作明细报价表
  • html网站代码网站建设学习流程
  • 网站备案 影响吗公司网站建设调研问卷
  • 四川时宇建设工程有限公司官方网站温州logo设计公司
  • 希腊网站 后缀wd网页设计教程
  • 114黄页兴安盟新百度县seo快速排名
  • 做的好的公司网站个旧市建设局网站
  • 网站页面制作公司商务网站开发背景
  • 做网站服务器多大的好网站建设类外文翻译
  • 做淘宝一样的网站网站建设问题