【发布时间】:2016-09-28 16:12:47
【问题描述】:
我正在尝试使用 WebCamTexture 在两个场景中显示电话摄像头,但是当我在我的 android 设备中加载第二个场景时,游戏崩溃了。我在摄像机前创建了一个平面(作为电影屏幕),并附上了这个脚本:
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour
{
public WebCamTexture mCamera;
public GameObject plane;
void Start ()
{
plane = GameObject.FindWithTag ("PlayerCam");
mCamera = new WebCamTexture ();
plane.GetComponent<Renderer>().material.mainTexture = mCamera;
mCamera.Play ();
}
}
在统一编辑器中一切正常,但是当我加载第二个场景时,我的 android 设备崩溃了。有人可以帮帮我吗?
【问题讨论】: