// 把這個腳本套用在攝影機中,沒意外左上角會出現攝影機照出來的貼圖

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour {

    void OnGUI(){
        Texture2D texture = new Texture2D (Screen.width, Screen.height, TextureFormat.RGB24, false);
        texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
        texture.Apply(false, false);

        GUI.DrawTexture(new Rect(00100100), texture);
    }

}

    全站熱搜

    黃彥霖 發表在 痞客邦 留言(1) 人氣()