IntelliJ IDEA破解补丁
此破解补丁在IntelliJ IDEA 2019.3.4测试通过,其它IntelliJ IDEA 2019.3.x版本应该也能破解。
- 下载 并解压,将jetbrains-agent.jar放到任意目录(比如:D:/jetbrains-agent.jar)
- 安装IntelliJ IDEA 2019.3.4,首次启动选择
Evaluate for free
试用30天
此破解补丁在IntelliJ IDEA 2019.3.4测试通过,其它IntelliJ IDEA 2019.3.x版本应该也能破解。
Evaluate for free
试用30天在Unity中打开c#(.cs)脚本每单独打开新的visual studio窗口。
要想所有c#脚本都在同一窗口打开怎么办?
解决:
打开visual studio-解决方案资源管理器中-选择你的项目-右键,选择“设为启动项目” 。
在Unity中调用TexturePacker打包图集,核心代码如下:
Process p = new Process ();
p.StartInfo.FileName = "TexturePacker";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
p.WaitForExit();
在Windows上运行正常,Mac上报异常:
Win32Exception: ApplicationName='TexturePacker', CommandLine='',
CurrentDirectory='' System.Diagnostics.Process.Start_noshell
(System.Diagnostics.ProcessStartInfo startInfo,
System.Diagnostics.Process process)
System.Diagnostics.Process.Start_common
(System.Diagnostics.ProcessStartInfo startInfo,
System.Diagnostics.Process process) System.Diagnostics.Process.Start
() (wrapper remoting-invoke-with-check)
System.Diagnostics.Process:Start ()
一番查找发现,Mac上应该用open命令调用目标应用,Mac版本的代码修改如下:
在Unity中使用Mono库System.Drawing.dll处理图像,Windows上一切正常,在Mac上运行报异常:
DllNotFoundException: gdiplus.dll
System.Drawing.GDIPlus..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus
System.Drawing.Bitmap..ctor (Int32 width, Int32 height, PixelFormat format)
System.Drawing.Bitmap..ctor (Int32 width, Int32 height)
(wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (int,int)
System.Drawing.dll内部依赖于gdiplus.dll,gdiplus.dll在Window上属于系统自带库所以一切正常。Mac上不存在gdiplus.dll,也未在网上找到独立的Mono版gidplus.dll。
但在Unity和MonoDevelop安装路径下有个libgdiplus.dylib,倒腾到dllmap中依旧异常,这两个路径下带的libgdiplus.dylib都不能正常使用。
最后安装了完整的Mono环境才搞定,Unity自带的Mono运行时是经过定制的这也能理解。
解决步骤如下:
在Unity3D开发项目时,有时需要进行路径是否存在的断定:
System.IO.File.Exist(string filePath);
System.IO.Directory(string dirPath);
注意这接口只是判定磁盘(闪存)物理路径上是否存在某个文件(目录),我们知道Application.streamingAssetsPath
取到的是StreamingAssets资源包路径,此资源包是Unity3D在编译时将工程目录StreamingAssets中的资源编译打包后生成的。
所以,我们尝试:
System.IO.File.Exist(Application.StreamingAssets + "/file.txt");
这样去判定文件是否存在时,会返回False,因为这本就不是一个文件物理路径。
Application.persistentDataPath
所指向路径,及其下的文件不会被Unity3D编译打包,其中的文件或目录是可以使用System.IO.File.Exist()接口判断是否存在的