如何避免 haxe Type class 和 C# Type class 之间的冲突?
How do I avoid conflicts between haxe Type class and C# Type class?
我正在开发用 C# 转换并插入到 Unity 项目中的 Haxe 代码。
转换工作正常,当我在 Unity 中单独导入它时,我能够使用生成的 class。
为了让它工作,我必须将整个生成的 src
文件夹引入 Unity,包括 Type.cs
文件。
但是,当我导入 "Post Processing Stack"(基本的 Unity 扩展)时,由于名称冲突而出现错误。 Type
class 也是一个基本的 C# class 并且它被 Post 处理脚本使用。
haxe-Type
优先,中断编译:
Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs(406,30): error CS1502: The best overloaded method match for `System.Collections.Generic.Dictionary<Type,System.Collections.Generic.KeyValuePair<UnityEngine.Rendering.CameraEvent,UnityEngine.Rendering.CommandBuffer>>.Add(Type, System.Collections.Generic.KeyValuePair<UnityEngine.Rendering.CameraEvent,UnityEngine.Rendering.CommandBuffer>)' has some invalid arguments
Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs(406,34): error CS1503: Argument `#1' cannot convert `System.Type' expression to type `Type'
我不知道是否可以通过使用 C#/Unity/Mono 搜索路径来解决这个问题。
我想知道将所有 haxe 顶级 classes 包装到 haxe
命名空间或特殊的 haxe-default
命名空间或前缀中是否更合适(可选)他们例如 class HType
。
这种基本类型的名称冲突可能会出现在许多其他上下文中,而不仅仅是在 Unity 中。
我在 C# 的 Haxe 文档中找到了解决方案:
https://github.com/HaxeFoundation/HaxeManual/wiki/Haxe-C%23
-D no-root generate package-less haxe types in the haxe.root namespace to avoid conflicts with other types in the root namespace
这样,全局级别的所有 类 都将在命名空间 haxe.root
下生成。
我正在开发用 C# 转换并插入到 Unity 项目中的 Haxe 代码。
转换工作正常,当我在 Unity 中单独导入它时,我能够使用生成的 class。
为了让它工作,我必须将整个生成的 src
文件夹引入 Unity,包括 Type.cs
文件。
但是,当我导入 "Post Processing Stack"(基本的 Unity 扩展)时,由于名称冲突而出现错误。 Type
class 也是一个基本的 C# class 并且它被 Post 处理脚本使用。
haxe-Type
优先,中断编译:
Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs(406,30): error CS1502: The best overloaded method match for `System.Collections.Generic.Dictionary<Type,System.Collections.Generic.KeyValuePair<UnityEngine.Rendering.CameraEvent,UnityEngine.Rendering.CommandBuffer>>.Add(Type, System.Collections.Generic.KeyValuePair<UnityEngine.Rendering.CameraEvent,UnityEngine.Rendering.CommandBuffer>)' has some invalid arguments
Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs(406,34): error CS1503: Argument `#1' cannot convert `System.Type' expression to type `Type'
我不知道是否可以通过使用 C#/Unity/Mono 搜索路径来解决这个问题。
我想知道将所有 haxe 顶级 classes 包装到 haxe
命名空间或特殊的 haxe-default
命名空间或前缀中是否更合适(可选)他们例如 class HType
。
这种基本类型的名称冲突可能会出现在许多其他上下文中,而不仅仅是在 Unity 中。
我在 C# 的 Haxe 文档中找到了解决方案: https://github.com/HaxeFoundation/HaxeManual/wiki/Haxe-C%23
-D no-root generate package-less haxe types in the haxe.root namespace to avoid conflicts with other types in the root namespace
这样,全局级别的所有 类 都将在命名空间 haxe.root
下生成。