Unity打包Pc(Windows)后,复制一个exe到打包后的Plugins文件夹

来源:互联网 发布:七星彩规律软件 编辑:程序博客网 时间:2024/06/06 20:10
#if UNITY_STANDALONE_WIN[UnityEditor.Callbacks.PostProcessBuild(999)]public  static  void OnPostprocessBuild (UnityEditor.BuildTarget BuildTarget, string path){if (BuildTarget != UnityEditor.BuildTarget.StandaloneWindows)return;//PC(WINDOWS)打包后期脚本:复制abc.exe到打包后的Plugins文件夹UnityEngine.Debug.Log (path);var strPathFrom= UnityEngine.Application.dataPath +"/Plugins/x86/abc.exe";var nIdxSlash = path.LastIndexOf ('/');var nIdxDot = path.LastIndexOf ('.');var strRootTarget = path.Substring ( 0 , nIdxSlash ) ;var strPathTargetFile = strRootTarget + path.Substring( nIdxSlash , nIdxDot-nIdxSlash )+"_Data/Plugins/abc.exe";System.IO.File.Copy(strPathFrom,strPathTargetFile);UnityEngine.Debug.Log ( "复制" + strPathFrom  + "\t到\t"+strPathTargetFile);}#endif

阅读全文
0 0
原创粉丝点击