LoginSignup
2
3

More than 5 years have passed since last update.

Unity 5.5.1f1で、Google VR SDK for Unity ver 1.10.0をimportすると出るエラーの解決方法

Last updated at Posted at 2017-01-28

UnityにGoogle VRをimportしたらエラーが出たので、その解決をメモ

環境

  • 開発
    • macOS
  • ツール等
    • Unity: ver 5.5.1f1
    • Google VR SDK for Unity: ver 1.10.0

現象

以下のエラーが出る。

Console
Assets/GoogleVR/Scripts/Video/GvrVideoPlayerTexture.cs(595,7): 
error CS1622: Cannot return a value from iterators. 
Use the yield return statement to return a value, or yield break to end the iteration

解決法

Assets/GoogleVR/Scripts/Video/GvrVideoPlayerTexture.csの
CallPluginAtEndOfFrames
return false;
をコメントアウト

ではなくて、
yield return null;に書き換える
が正解だと思われる。

補足

GvrVideoPlayerTexture.cs(591行〜)
  private IEnumerator CallPluginAtEndOfFrames() {
    if (processingRunning) {
      Debug.LogError("CallPluginAtEndOfFrames invoked while already running.");
      Debug.LogError(StackTraceUtility.ExtractStackTrace());
      return false;
    }

処理の内容的に、
if (processingRunning)だったら、エラーログを吐いて終了を意図しているっぽい。
かつ、この関数はIEnumeratorの型なので、終了するためのyield return null;と書き換えるのが正しいはず。

以上。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3