Unity 部分错误信息提示

1.平台编译错误或库引用缺失

错误提示:error CS1061: Type `System.IO.FileInfo' does not contain a definition for `Delete' and no extension method `Delete' of type `System.IO.FileInfo' could be found (are you missing a using directive or an assembly reference?)

出了这个错误一般有两个原因了。

1.没有引用相关的库。

2.选错编译平台。(BuildSetting里面的Platform)


2.编码切换警告提示。

警告提示:Some are Mac OS X (UNIX) and some are Windows.

This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

编码格式问题,VS的话直接高级保存方案里面修改,一般我选的是UNICODE(UTF8代签名)MACINTOSH(CR),WINDOW下的可以选WINDOWS的格式,两边都要用的话,推荐选CR。

BUG:IOS下,游戏中的中文显示乱码。

解决方式:同上,修改改代码页的编码。UNICODE(UTF8代签名)MACINTOSH(CR)


3:`UnityEditor.BuildPipeline.BuildAssetBundles(string)' is obsolete: `BuildAssetBundles signature has changed. Please specify the targetPlatform parameter'

4:UnityEditor.UI.dll' is in timestamps but is not known in guidmapper...                

解决方法:重新导入UnityEditor.UI.dll     参考来自:https://forum.unity3d.com/threads/unityengine-ui-dll-is-in-timestamps-but-is-not-known-in-assetdatabase.274492/

使用如下代码:

using UnityEngine; 
using System.Collections.Generic; 
using UnityEditor; 
using System.Text.RegularExpressions; 
using System.IO; 
using System.Text; 

public class ReimportUnityEngineUI { 
	[MenuItem("Assets/Reimport UI Assemblies", false, 100)] 
	public static void ReimportUI() { 
		#if UNITY_4_6 
		var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{0}/{1}"; 
		var version = Regex.Match(Application.unityVersion, @"^[0-9]+\.[0-9]+\.[0-9]+").Value; 
		#else 
		var path = EditorApplication.applicationContentsPath + "/UnityExtensions/Unity/GUISystem/{1}"; 
		var version = string.Empty; 
		#endif 
		string engineDll = string.Format(path, version, "UnityEngine.UI.dll"); 
		string editorDll = string.Format(path, version, "Editor/UnityEditor.UI.dll"); 
		ReimportDll(engineDll); 
		ReimportDll(editorDll); 

	} 
	static void ReimportDll(string path) { 
		if (File.Exists(path)) 
			AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); 
		else 
			Debug.LogError(string.Format("DLL not found {0}", path)); 
	} }
适用于各个版本,我是在5.5.0版本上遇到的

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值