#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
Unity打包Pc(Windows)后,复制一个exe到打包后的Plugins文件夹
最新推荐文章于 2024-06-12 15:23:25 发布