Skip to content

Instantly share code, notes, and snippets.

@kurianbenoy
Created July 10, 2018 03:08
Show Gist options
  • Save kurianbenoy/0b906f93677f857f613c55061725ba36 to your computer and use it in GitHub Desktop.
Save kurianbenoy/0b906f93677f857f613c55061725ba36 to your computer and use it in GitHub Desktop.
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