简体   繁体   English

WP8应用中的Unity-闪烁和暂停播放器

[英]Unity in WP8 App - Flickering and pausing player

I am porting an unity app to windows phone 8. Its basically just an animated background. 我正在将一个统一的应用程序移植到Windows Phone8。它基本上只是一个动画背景。 While changing the data inside my wp8 project i am updating the unity background. 在更改wp8项目中的数据时,我正在更新统一背景。 I need to put an pivot control on top of the background. 我需要在背景顶部放置一个透视控件。 The background of the pivot is transparent. 枢轴的背景是透明的。 While changing the selected item the pivot control starts to flicker and even disappears somethings (its returning when the manipulation is completed). 更改所选项目时,枢轴控件开始闪烁,甚至消失一些(操作完成后返回)。 The pivot control works fine, without the unity background. 枢轴控件工作正常,没有统一的背景。

I tried to pause the unity game while manipulating the pivot control but this doesnt work. 我试图在操纵枢轴控件时暂停统一游戏,但这不起作用。 Here is the code of pausing the game in Unity. 这是在Unity中暂停游戏的代码。

void PauseGame(bool p)
{
    if (p)
    {
        Time.timeScale = 0.0f;
    }
    else Time.timeScale = 1.0f;
}

I also tried to UnityApp.Obscure and UnityApp.Unobscure the unity input, but that doesnt work either. 我还尝试了UnityApp.ObscureUnityApp.Unobscure统一输入,但这也不起作用。 I even tried to hide the DrawingSurfaceBackground and setting an image in front of it, but still no luck. 我什至试图隐藏DrawingSurfaceBackground并在其前面设置图像,但是还是没有运气。

Is there a way to pause the unity player out of my wp8 solution (like UnityPlayer.Pause() )? 有没有办法将统一播放器从wp8解决方案中暂停(例如UnityPlayer.Pause() )? Where I dont have to call a function in Unity (like the PauseGame() )? 在哪里我不必在Unity中调用函数(例如PauseGame() )? I need the animated background while the pivot is not manipulated. 在不操作枢轴的情况下,我需要动画背景。

Thanks in advance. 提前致谢。

robidd 烂透了

I've found out why the pivot control flickers on manipulation. 我发现了为什么枢轴控件在操纵时会闪烁。 I have set the Background to black and the opacity to 0.7. 我将背景设置为黑色,将不透明度设置为0.7。 By removing those attributes the flickering stopped. 通过删除这些属性,闪烁停止了。 Now i dont need to stop the unity player. 现在,我不需要停止统一播放器。 I set an black image with opacity 0.7 instead of the pivot background and now it all works. 我设置了不透明度0.7而不是轴心背景的黑色图像,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM