Unity to xcode Error

时间:2017-10-25 21:27:25

标签: ios xcode unity3d

[这里是错误] [1] 我每次使用从单位导出的代码

获取此消息
#if UNITY_CAN_USE_METAL

#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>

#else

typedef NSUInteger MTLPixelFormat;
enum
{
    MTLPixelFormatBGRA8Unorm,
    MTLPixelFormatBGRA8Unorm_sRGB,
};
 ......................

#endif

1 个答案:

答案 0 :(得分:0)

我缺乏上述评论的声誉,所以:

在Unity-iPhone / Classes / Unity / UnityMetalSupport.h中,第20-25行:

typedef NSUInteger MTLPixelFormat;
enum
{
    MTLPixelFormatBGRA8Unorm,
    MTLPixelFormatBGRA8Unorm_sRGB,
};

Xcode 9.0.1出现以下错误:

Line 20: Typedef redefinition with different types ('NSUInteger' (aka 'unsigned long') vs 'enum MTLPixelFormat')
Line 23: Redefinition of enumerator 'MTLPixelFormatBGRA8Unorm'
Line 24: Redefinition of enumerator 'MTLPixelFormatBGRA8Unorm_sRGB'

我的xcodeproj是由Unity 5.5.2f1生成的。