Unity3d 加载UnityEngine.UI.dll 失败导致 Prefab 上 脚本丢失
来源:互联网 发布:iphone蜂窝数据开关 编辑:程序博客网 时间:2024/05/16 14:52
Unity3d 加载UnityEngine.UI.dll 失败导致 Prefab 上 脚本丢失,引发各种 NullException
在 Unity 官方论坛找到的解决方法是重新加载 UnityEngine.UI.dll ,把下面的脚本扔到项目里,然后右键菜单中就会出现
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;#elif UNITY_4_7 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)); }}
0 0
- Unity3d 加载UnityEngine.UI.dll 失败导致 Prefab 上 脚本丢失
- Unity3d 加载UnityEngine.UI.dll失败的解决方案(2017.2)
- sfc.dll丢失导致dll加载失败
- unity3d 动态加载 prefab
- Unity3D: 动态加载Prefab
- [Unity3D]BuildPipeline.PushAssetDependencies 打包依赖包,优化UI Prefab的资源引用加载
- 未加载ntdll.dll符号导致调用栈信息丢失
- Unity3D 运行时 动态加载 预设 prefab
- Unity3d中加载资源prefab的方法
- Window7丢失libeay32.dll导致上不了网
- LIBEAY32.dll丢失导致上不了网的解决办法
- unity ui dll丢失
- JS脚本导致Session丢失
- Unity3D 优化 3 ( Animator影响Prefab的加载 )
- jscript.dll 加载失败
- dll加载失败
- dll文件加载失败
- LoadLibraryA加载dll失败
- Android N for Developers
- angularjs 实现国际化
- vtk三维场景基本要素
- Ubuntu 美化教程:安装平面风格的主题
- Git教程
- Unity3d 加载UnityEngine.UI.dll 失败导致 Prefab 上 脚本丢失
- java 数据采集
- 工作漏洞总结
- c++相关链接总结
- UTF-8 到底需不需要 BOM?
- 在 OS X 中安裝 GNU GCC 以及使用 bits/stdc++.h 头文件 Policy-Based Data Structure
- mysql5.7.12直接解压zip包,安装过程
- Cocos2d—X游戏开发之(socket)Mac下网络抓包工具(Cocoa Packet Analyzer使用教程)
- 用TeXStudio打开WinEdt Latex中文乱码的解决办法