赞
踩
错误: error CS0683: UniRx.ReactiveCollection<T>.IReactiveCollection<T>.get_Item(int)' explicit method implementation cannot implement
UniRx.IReactiveCollection<T>.this[int].get' because it is an accessor
- interface IExample
- {
- int Test { get; }
- }
-
- class CExample : IExample
- {
- //原
- int IExample.get_Test() { return 0; } // CS0683
- //修改后
- int IExample.Test { get{ return 0; } } // correct
- }
- //原
- T IReactiveCollection<T>.get_Item(int index)
- {
- return base[index];
- }
-
- void IReactiveCollection<T>.set_Item(int index, T value)
- {
- base[index] = value;
- }
-
- T IReadOnlyReactiveCollection<T>.get_Item(int index)
- {
- return base[index];
- }
-
- //修改后
- public new T this[int index]
- {
- get
- {
- return base[index];
- }
- set
- {
- base[index] = value;
- }
- }
错误:CS433:类型“MonoBehaviour同时存在于UnityEngineCoreModuleVersion0.0.0.0.Cultureneutral PublicKeyTokennull和“UnityEngineVersion0.0.0.0,CultureneutralPublicKeyTokennull中
删掉UnityEngine.dll
UNITY某个新版本后,把UnityEngine.dll的东西全部拆解到其它DLL了,主要核心功能在UnityEngine.coreModule.dll中,其它功能比如UnityEngine.Coremodule等。 而UnityEngine.dll完全是一个空壳,打开看里面全是空类,空代码。
错误:Unity打包WebGL在网页运行出现“To use diopen,you need yo use Emscript's linking support”问题解决方法。
**错误:** $LOAD_DATA_FROM_SUBPACKAGE is not defined
1.检查打包的路径是否有中文,如果有中文,则可能会导致minigame/wasmcode/.webgl.wasm.code.unityweb.wasm.br代码分包文件无法生成
2.在转换小游戏时,要确保代码分包和资源首包的加起来的文件大小不能超过20M
错误:An error occurred while resolving packages: Project has invalid dependencies: com.unity.package-manager-ui: Package [com.unity.package-manager-ui@2.1.2] cannot be found Package com.unity.textmeshpro@2.0.0 has invalid dependencies: com.unity.ugui: Package [com.unity.ugui@1.0.0] cannot be found
把工程目录下的Packages目录中的manifest.json删掉, 然后再自动生成
错误:error CS0433: The imported type System.Xml.XmlNode is defined multiple times
方法一:将Plugins文件夹中System.Xml.dll移除
方法二:File - Build Setting - Player Setting - Other Settings - Scripting Runtime Version - 改为.Net 4.x
错误:Errors during import of AudioClip Assets/Resources/sounds/effects/Battle_TroopB_Shoot3.wav:
FSBTool ERROR: The format of the source file is invalid, see output for details.
FSBTool ERROR: Internal error from FMOD sub-system.
方法一:检查音频文件的采样率:Unity可能无法处理某些特定的采样率。尝试将音频文件的采样率更改为44100Hz或48000Hz。
方法二:重新导入音频文件:右键 - ReImport
错误:Compile error CS0079 : The event 'CustomEvent' can only appear on the left hand side of += or -=
- //原
- private Action<AndroidImagePickResult> m_OnImagePicked;
-
- public event Action<AndroidImagePickResult> OnImagePicked
- {
- add
- {
- Action<AndroidImagePickResult> action = this.m_OnImagePicked;
- Action<AndroidImagePickResult> action2;
- do
- {
- action2 = action;
- action = Interlocked.CompareExchange(ref this.m_OnImagePicked, (Action<AndroidImagePickResult>)Delegate.Combine(action2, value), action);
- }
- while (action != action2);
- }
- remove
- {
- Action<AndroidImagePickResult> action = this.m_OnImagePicked;
- Action<AndroidImagePickResult> action2;
- do
- {
- action2 = action;
- action = Interlocked.CompareExchange(ref this.m_OnImagePicked, (Action<AndroidImagePickResult>)Delegate.Remove(action2, value), action);
- }
- while (action != action2);
- }
- }
-
- public AndroidCamera()
- {
- this.OnImagePicked = delegate
- {
- };
- base._002Ector();
- }
-
- //修复后
- public event Action<AndroidImagePickResult> OnImagePicked;
- public AndroidCamera()
- {
- this.OnImagePicked = delegate
- {
- };
- }
错误: error CS0619: ' xxxxxx ' is obsolete: ' xxxxx export is no longer supported .'
//原 //改
RuntimePlatform.OSXWebPlayer RuntimePlatform.OSXPlayer
RuntimePlatform.WindowsWebPlayer RuntimePlatform.WindowsPlayer//原
gameObject.transform.position = new Vector3(0f, 1f);
guiText.anchor = TextAnchor.UpperLeft;
guiText.alignment = TextAlignment.Left;
guiText.pixelOffset = pixelOffset;//改
textComponent.rectTransform.localPosition = new Vector3(0f, 1f);
textComponent.alignment = TextAnchor.UpperLeft;
textComponent.alignment = TextAlignment.Left;
textComponent.rectTransform.anchoredPosition = pixelOffset;RuntimePlatform.OSXDashboardPlayer //停止使用
错误:ssembly ‘XXX.DLL’ will not be loaded due to errors: XXX references strong named ICSharpCode.SharpZipLib Assembly references: 0.85.5.452 Found in project: 0.86.0.518.Assembly Version Validation can be disabled in Player Settings “Assembly Version Validation”
Edit - Project Settings - Player - Other Settings - Assembly Version Validation
错误:error CS0636: The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit)
//原
[StructLayout(2)]
private struct DoubleLongBytesUnion
{
[FieldOffset(0)]
public double d;
}//改
[StructLayout(LayoutKind.Explicit)]
private struct DoubleLongBytesUnion
{
[FieldOffset(0)]
public double d;
}
错误:cannot explicitly call operator or accessor
this.get_myKick 改成 ()=>myKick
错误:提示参数shader
为空
Edit - Project Settings - Graphics ; 将需要用到的shader拖拽进来
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。