经过对谷歌和官方文档的更多挖掘。我得到了解决方案,我将与您分享,它会帮助某人..有一天..
1.创建新项目。
2.在GameObject中选择Main Camera并通过Inspector更改Transform
位置 X= -90 Y=785 Z=0 旋转 X=90 Y=90 Z=0 比例 X=1 Y=1 Z=1
3.现在进入GameObject —> Create Other —> Plane。
4.在GameObject中选择Main Camera并
4.1 通过 Inspector 改变 Transform
Position X=0 Y=0 Z=0 Rotation X=0 Y=0 Z=0 Scale X=100 Y=100 Z=100
4.2 更改Tag=Player
现在创建一个名为“CameraController”的 C# 脚本,并将代码替换为以下代码
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour
{
public WebCamTexture mCamera = null;
public GameObject plane;
// Use this for initialization
void Start ()
{
Debug.Log ("Script has been started");
plane = GameObject.FindWithTag ("Player");
mCamera = new WebCamTexture ();
plane.renderer.material.mainTexture = mCamera;
mCamera.Play ();
}
// Update is called once per frame
void Update ()
{
}
}
5.最后保存并将此脚本文件拖到“Plane”游戏对象上
注意 - 您可能会看到预览在 Unity 游戏视图中旋转,但在 RealDevice 上效果良好。在 iPhone5 和 Android - Nexus 5 上进行了测试。
Here is the snap shot how it comes if you change rotation angle to 180: