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;
と書き換えるのが正しいはず。
以上。