Created
July 10, 2018 03:08
-
-
Save kurianbenoy/0b906f93677f857f613c55061725ba36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CameraScript : MonoBehaviour | |
{ | |
static WebCamTexture backCam; | |
void Start() | |
{ | |
if (backCam == null) | |
backCam = new WebCamTexture(); | |
GetComponent<Renderer>().material.mainTexture = backCam; | |
if (!backCam.isPlaying) | |
backCam.Play(); | |
} | |
void Update() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment