Snow Leopard的64位Safari和Unity

Update: We have released Unity 2.6.1 on December 2nd this year, which includes an update to the Mac Unity Web Plugin, which is fully compatible with 64-bit Safari on OS X 10.6 Snow Leopard.

更新: 我们于今年12月2日发布了Unity 2.6.1,其中包括对Mac Unity Web插件的更新,该插件与OS X 10.6 Snow Leopard上的64位Safari完全兼容。

So, most of you have probably heard the news: Apple is going to release Mac OS X 10.6 “Snow Leopard” this Friday. This release will give Mac users plenty of new feature goodness and new technologies to play with, and brings a lot of changes under the hood. Unfortunately, I must inform you that one of these changes may cause some grief for Unity users, at least for the time being:

因此,你们中大多数人可能已经听说了这个消息:苹果将在本星期五发布Mac OS X 10.6“ Snow Leopard”。 此版本将为Mac用户提供大量新功能,并提供新技术,并带来许多变化。 不幸的是,我必须通知您,这些更改之一可能会给Unity用户带来一定的痛苦,至少暂时是这样:

Apple reengineered Safari to run as a full 64-bit application. While this is a good thing, it has a pretty big impact on plugin developers like us. Even though plugins do not actually need to be 64-bit binaries themselves, since they are now running as separate processes, they need to communicate with Safari using new 64-bit capable APIs. Basically, the old Carbon-based NPAPI is being replaced with a Cocoa-based version, which requires a lot of restructuring of plugin code.

苹果对Safari进行了重新设计,使其可以作为完整的64位应用程序运行。 尽管这是一件好事,但它对像我们这样的插件开发人员产生了很大的影响。 尽管插件本身实际上并不需要是64位二进制文​​件,但由于它们现在作为单独的进程运行,因此它们仍需要使用支持64位的新API与Safari通信。 基本上,旧的基于Carbon的NPAPI被基于Cocoa的版本所取代,这需要大量的插件代码重组。

Unfortunately, this change sort of caught us by surprise – the APIs which are now required have just been publically released in Safari 4.0, and are now being made mandatory to use in Snow Leopard less than three months later. Which now means that we won’t be able to ship a working web plugin for 64-bit by it’s release date this friday. We are working on it as hard as we can, and we do have a working proof of concept of Unity web content displaying in 64-bit Safari. We aim to release an updated plugin in October.

不幸的是,这种变化让我们感到惊讶-现在所需的API刚刚在Safari 4.0中公开发布,并且现在已被强制在不到三个月的时间内在Snow Leopard中使用。 现在,这意味着我们无法在本星期五的发布日期之前交付适用于64位的网络插件。 我们正在竭尽全力,并且确实有一个工作原理证明了在64位Safari中显示Unity Web内容的概念。 我们的目标是在10月发布更新的插件。

Until then, there are two possibly ways to play Unity web content on Snow Leopard: One is to use Firefox, which still works as always. The other one is to set up Safari to run in 32-bit mode. To do that, click Safari in the Finder, select Get Info from the context menu, and click on Open in 32-bit mode.

在此之前,有两种可能的方法可以在Snow Leopard上播放Unity Web内容:一种是使用Firefox,它仍然可以正常运行。 另一个是将Safari设置为以32位模式运行。 为此,请在Finder中单击Safari,从上下文菜单中选择“ 获取信息 ”,然后单击“ 以32位模式打开”

Setting Safari to use 32-bit mode

When users open web pages with Unity content in 64-bit Safari, all they will see is a blank screen where the content should be. However, it is possible to detect this situation from JavaScript, so you can at least display a meaningful error message on your site. When the plugin fails to load, the GetPluginVersion() function is undefined. Here’s some sample code, showing how to use that to display an error message:

当用户在64位Safari中打开包含Unity内容的网页时,他们所看到的只是空白内容所在的屏幕。 但是,可以从JavaScript中检测到这种情况,因此您至少可以在网站上显示有意义的错误消息。 当插件无法加载时,未定义GetPluginVersion()函数。 这是一些示例代码,显示了如何使用它显示错误消息:


if (navigator.appVersion.indexOf("Safari") != -1
&& navigator.appVersion.indexOf("Mac OS X 10_6") != -1
&& document.getElementById("UnityEmbed").GetPluginVersion == undefined)
{
document.write('<br>You are running Safari in 64-bit mode, which is not yet supported by ')
document.write('the Unity web plugin.<br>');
document.write('To see the content, switch Safari to 32-bit mode, or use Firefox. <br>');
document.write('See <a href="http://blogs.unity3d.com/?p=1358">this blog post</a>');
document.write(' for more information. <br>');
}


if (navigator.appVersion.indexOf("Safari") != -1
&& navigator.appVersion.indexOf("Mac OS X 10_6") != -1
&& document.getElementById("UnityEmbed").GetPluginVersion == undefined)
{
document.write('<br>You are running Safari in 64-bit mode, which is not yet supported by ')
document.write('the Unity web plugin.<br>');
document.write('To see the content, switch Safari to 32-bit mode, or use Firefox. <br>');
document.write('See <a href="http://blogs.unity3d.com/?p=1358">this blog post</a>');
document.write(' for more information. <br>');
}

If you are using our default html template, you can just add this code after the line document.write(”);.

如果您使用的是默认的html模板,则只需在document.write(”);行之后添加此代码即可

We apologize for any inconveniences this causes, and, as always, we will try to resolve the issue ASAP. Looking forward, though, moving to these new APIs will make the Unity web experience a better one, as this allows us to do more robust input handling, and proper layering of Unity content with other parts of your web site.

对于由此给您带来的任何不便,我们深表歉意,并且一如既往,我们将尽快解决该问题。 但是,展望未来,转向这些新的API将使Unity Web体验变得更好,因为这使我们能够进行更强大的输入处理,并将Unity内容与网站的其他部分正确地分层。

Oh, and before anyone asks: The Unity editor as well as standalone games made with Unity are unaffected by this issue.

哦,在有人问之前:Unity编辑器以及使用Unity制作的独立游戏不受此问题的影响。

翻译自: https://blogs.unity3d.com/2009/08/25/snow-leopards-64-bit-safari-and-unity/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值