3DSelfie  Hansjoerg Hofer (1026632), Sebastian Metzler (0927550)
testImage.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 
4 public class testImage : MonoBehaviour {
5 
6 
7 
8  GameObject resizeQuad;
9  grabPicture grabScript;
10 
11 
12  // Use this for initialization
13  void Start () {
14 
15  resizeQuad = GameObject.Find ("ResizeQuad");
16  grabScript = GameObject.Find ("2texCam").GetComponent<grabPicture> ();
17 
18  }
19 
20  bool test = false;
21  bool isFront = true;
22 
23  public Texture front;
24  public Texture side;
25  public Texture renTex;
26 
33  void Update () {
34 
35 
36 
37  if (Input.GetKeyDown ("t")) {
38  test = !test;
39 
40  if(test){
41 // isFront = true;
42  resizeQuad.GetComponent<Renderer>().material.SetTexture("_MainTex", front);
43  }else{
44 
45  resizeQuad.GetComponent<Renderer>().material.SetTexture("_MainTex", renTex);
46  }
47  }
48 
49  if (grabScript.renderStep == 5 && test) {
50 
51  resizeQuad.GetComponent<Renderer>().material.SetTexture("_MainTex", side);
52 // isFront = false;
53  }
54  }
55 }
Texture side
Definition: testImage.cs:24
int renderStep
Definition: grabPicture.cs:10
Texture renTex
Definition: testImage.cs:25
Texture front
Definition: testImage.cs:23