This commit is contained in:
Victor Giers
2021-03-05 01:13:05 +01:00
commit 82c534459a
2096 changed files with 201670 additions and 0 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 hbksaar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Binary file not shown.

View File

@@ -0,0 +1,254 @@
import processing.video.*;
import ddf.minim.*;
import processing.opengl.*;
import processing.net.*;
int port = 50000;
Server myServer;
PApplet app; //technically needed to create movie instances inside of a class
PImage blob;
boolean debug = false; //new: activate it to see the movies in the background
WordedImageLayer[] layers = new WordedImageLayer[4];
Minim minim;
AudioPlayer song;
Button []button= new Button[8];
PFont f;
PFont f1;
PFont f2;
Text[] t1, t2, t3;
Stock[]stocks= new Stock[26];
float totalW =0 ;
float totalH=0;
int wordCount = 26;
boolean start=false;
boolean level1=false;
boolean level2=false;
boolean level3=false;
boolean level4=false;
boolean screen;
boolean win;
PImage Buttona, Button11, Button1, Button2, Button12, ButtonMovie;
int laserX, laserY;
void movieEvent(Movie m) {
m.read();
}
Movie door;
void setup() {
size(2000, 300, P3D);
myServer = new Server(this, port);
door = new Movie (this, "part1.mov");
//doorclicked = new Movie (this, "part2.mov");
door.play();
blob = loadImage("blob.png");
app = this;
layers[0] = new WordedImageLayer("0.mov", "door", 0, 100, 10);
layers[1] = new WordedImageLayer("3.mov", "door", 0, 10, 40);
layers[2] = new WordedImageLayer("wave15.mov", "DOOR", 0, 20, 30); //new: make threshold a negative number to inverse it.
layers[3] = new WordedImageLayer("4.mov", "DOOR", 0, 100, 34);
//layers[4] = new WordedImageLayer("4.mov", "DOOR", 0, 100, 20);
//layers[5] = new WordedImageLayer("5.mov", "smoke", 0, 200, 7);
layers[0].togglePlaying();
layers[1].startPlaying();
layers[1].stopPlaying();
layers[2].togglePlaying();
layers[3].togglePlaying();
minim= new Minim(this);
// you have to change the name of the sound and drog and drop in the sketch
song =minim.loadFile ("door24.mp3");
float x = 0;
float y=0;
f= createFont("Monospaced-48", 10);
f1 = loadFont("Avenir-Roman-48.vlw");
f2= loadFont("SansSerif-48.vlw");
Button1 = loadImage("Button1.png");
Button2 = loadImage("Button2.png");
Buttona = loadImage("Buttona.png");
Button11 = loadImage("Button11.png");
Button12 = loadImage("Button12.png");
ButtonMovie = createImage(door.width, door.height, ARGB);
button[0]= new Button (250, 200, 100, Buttona.width/10, Buttona.height/10, 1, Buttona, "intro");
button[1]=new Button (100, 100, 100, Button11.width/10, Button11.height/10, 1, Button11, "virus");
button[2]=new Button (200, 150, 100, Button1.width/10, Button1.height/10, 1, Button1, "sound");
button[3]=new Button (10, 250, 100, Button2.width/10, Button2.height/10, 1, Button2, "color");
button[4]=new Button (350, 150, 100, Button12.width/10, Button12.height/10, 1, Button12, "levelone");
button[5]=new Button (250, 10, 100, Buttona.width/10, Buttona.height/10, 2, Buttona, "leveltwo");
button[7]=new Button (350, 210, 100, Buttona.width/10, Buttona.height/10, 2, Buttona, "leveltree");
//bouton door !!666
button[6]=new Button (100, 100, 100, ButtonMovie.width/5, ButtonMovie.height/5, 1, ButtonMovie, "doorbutton");
t1=new Text [wordCount];
t2=new Text [wordCount];
t3=new Text [wordCount];
for (int i=0; i< wordCount; i++) {
t1[i]=new Text ("DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR ", 0, 30*i, -30, 1);
t2[i]=new Text ("DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR ", 0, 30*i, -10, 1);
t3[i]=new Text ("DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR DOOR ", 0, 30*i, 10, 2);
}
for (int j = 0; j < stocks.length; j++) {
stocks[j]= new Stock("DOOR DOOR DOOR DOOR DOOR", 100, 30, -100, 1);
}
for (int i = 0; i < stocks.length; i++) {
stocks[i].setX(x);
x = x + (stocks[i].textW());
y = y + (stocks[i].textH());
}
totalH = y;
totalW = x;
start = true;
level1 = true;
}
void draw() {
background(0);
getLaser();
try {
if ((!start)) {
if (!screen) {
for (int i = 0; i < stocks.length; i++) {
stocks[i].move();
stocks[i].display();
}
if (!screen) {
button[0].display();
button[0].move();
// println("je suis la");
}
}
textAlign(LEFT);
//textSize(40);
textFont(f2);
textLeading(10);
String s= "FIND THE DOOR !";
String h="click on the button to start...";
String d="But...Can you find the good one?";
text(s, 200, 50);
textSize(30);
text(h, 200, 110);
text(d, 200, 160);
} else if ((!level1)) {
for (int i = 0; i < stocks.length; i++) {
stocks[i].move();
stocks[i].display();
}
for (int i =0; i<wordCount; i++) {
t1[i].display();
t2[i].display();
t3[i].display();
t1[i].move();
t2[i].move();
t3[i].move();
t1[i].interact();
t2[i].interact();
t3[i].interact();
}
button[1].display();
button[1].move();
button[2].display();
button[2].move();
button[3].display();
button[3].move();
if (!screen) {
button[4].display();
button[4].move();
}
} else if ((!level2)) {
for (int i = 0; i < stocks.length; i++) {
stocks[i].move();
stocks[i].display();
}
layers[1].update();
layers[0].update();
button[4].display();
button[4].move();
button[5].display();
button[5].move();
println("level1");
}
else if ((!level3)) {
button[6].display();
for (int i = 0; i < stocks.length; i++) {
stocks[i].move();
stocks[i].display();
}
layers[2].update();
if (!screen) {
println("level2");
button[5].display();
button[5].move();
button[7].display();
button[7].move();
}
} else if ((!level4)) {
for (int i = 0; i < stocks.length; i++) {
stocks[i].move();
stocks[i].display();
}
button[5].display();
button[5].move();
println("reviens");
button[7].display();
button[7].move();
println("level3");
layers[3].update();}}
catch (Exception a) {
}
if (door.time() >= door.duration()) {
replay();
}
}
void mousePressed() {
for (int i=0; i< button.length; i++) {
if (button[i].hover()) {
button[i].clicked();
}
}
for (int i = 0; i < layers.length; i++) {
if (layers[i].hover()) {
println("Clicked layer " + i + "!");
//you could call the following function with a button. (are there really going to be buttons in final version?)
layers[i].togglePlaying();
}
}
}

View File

@@ -0,0 +1,94 @@
class Button {
int x, y, z, w, h;
int xspeed;
PImage img;
String WhatToDo;
boolean hover() {
if (laserX>x && laserX< x +w&& laserY>y && laserY<y+h) {
return true;
} else {
return false;
}
}
Button (int X, int Y, int Z, int W, int H, int Xspeed, PImage Img, String WTD) {
x= X;
y = Y;
z=Z;
xspeed=Xspeed;
w = W;
h = H;
img = Img.get();
WhatToDo = WTD;
}
void clicked() {
if (WhatToDo.equals("color")) {
for (int i=0; i< t1.length; i++) {
t1[i].apparition();
t2[i].apparition();
t3[i].apparition();
stocks[i].apparition();
}
}
if (WhatToDo.equals("virus")) {
for (int i=0; i< t1.length; i++) {
t1[i].crazy();
t2[i].crazy();
t3[i].crazy();
}
}
if (WhatToDo.equals("sound")) {
song =minim.loadFile ("door24.mp3");
song.play();
}
if (WhatToDo.equals("intro")) {
start = true;
}
if (WhatToDo.equals("levelone")) {
level1 =! level1;
}
if (WhatToDo.equals("leveltwo")) {
level2 =! level2;
}
if (WhatToDo.equals("leveltree")) {
level3 =! level3;
}
if (WhatToDo.equals("doorbutton")) {
//THIS IS THE GAMES ENDING!! YOU CLICKED THE DOOR!! WHAT HAPPENS NOW?
win = true;
//play second door video.
door.stop();
door = new Movie (app, "part2.mov");
door.play();
}
}
void display() {
if (WhatToDo.equals("doorbutton")) {
img = door.get();
println(img.width);
}
image(img, x, y, w, h);
}
void randomPosition() {
x = int(random(0, width - w));
y = int(random(0, height - h));
}
void move() {
x=x+xspeed;
if (x < 0 || x > width-w) {
xspeed=-xspeed;
}
}
}

View File

@@ -0,0 +1,84 @@
class WordedImageLayer {
Movie sourceMovie;
PGraphics canvas;
PImage getmov;
PImage mov;
String word;
String movFileName;
boolean inverse;
boolean hover;
boolean isPlaying;
int threshold;
int detailfactor;
int movX;
int movY = 0;
int movW;
int movH;
WordedImageLayer(String MovName, String Word, int X, int thresh, int Factor) {
movFileName = MovName;
word = Word;
movX = X;
threshold = thresh;
detailfactor = Factor;
sourceMovie = new Movie(app, movFileName);
}
void startPlaying() { //new-
sourceMovie.loop();
isPlaying = true;
}
void stopPlaying() { //-functions-
sourceMovie.stop();
isPlaying = false;
}
void togglePlaying() { //-yay!
if (isPlaying)
stopPlaying();
else
startPlaying();
}
boolean hover() {
if (laserX > movX && laserX < movX + movW && laserY > movY && laserY < movY + movH)
return true;
else
return false;
}
void update() {
if (isPlaying) { //new! check if isplaying. so you can just keep the for loops that update every video. it will break here if the video shall not be running.
try {
mov = sourceMovie.get();
mov.resize(0, height);
movW = mov.width;
movH = mov.height;
canvas = createGraphics(movW, movH);
canvas.beginDraw();
canvas.imageMode(CORNER);
canvas.image(mov, 0, 0, canvas.width, canvas.height);
canvas.imageMode(CENTER);
canvas.image(blob, laserX-movX, laserY, height/3, height/3);
mov = canvas.get();
canvas.endDraw();
mov.resize(0, height/detailfactor);
if (debug) {
tint(255, 60);
image(canvas, movX, 0);
tint(255, 255);
}
mov.loadPixels();
for (int i=0; i<mov.pixels.length; i++ ) {
int col = mov.pixels[i];
if (brightness(col) > threshold) {
//int x = i%mov.width*detailfactor;
int x = int(map(i%mov.width*detailfactor, 0, mov.width, 0, movW/detailfactor)); //new! fixes a bug where the cursor was out of place
int y = i/mov.width*detailfactor+10;
text(word, x+movX, y);
}
}
}
catch (Exception e) {
}
}
}
}

View File

@@ -0,0 +1,63 @@
class Stock {
String w; // Name
int val; // Value
float x; // x position
float y;
float z;
int xspeed;
color colorw =255 ;
String display;
boolean colorActif;
Stock(String tempw, float xpos, float tempz, float ypos, int Xspeed) {
w= tempw;
z=tempz;
x=xpos;
y=ypos;
xspeed=Xspeed;
// Concatenate the name, value and some spaces
display = w + " " ;
}
// A function to set x position
void setX(float x_) {
x = x_;
}
void display() {
for (int i = 0; i < stocks.length; i++) {
fill(colorw);
textFont(f);
text(display, x, height-25*i);
}
if (colorActif) {
for (int i = 0; i < stocks.length; i++) {
fill( int(random(2))*255, int(random(2))*255, int(random(2))*255);
textFont(f);
text(display, x, height-25*i);
}
}
}
float textW() {
textFont(f);
return textWidth(display);
}
float textH() {
textFont(f);
return textAscent() + textDescent();
}
void move() {
x = x - 1;
y= y-1;
if (x < width-totalW && y < height-totalH) {
x = width;
y= height;
}
}
void apparition() {
colorActif =! colorActif;
}
}

View File

@@ -0,0 +1,81 @@
class Text {
String w;
int x;
int y;
int z;
color colorw =color( random(0, 255)) ;
int xspeed;
float textw;
float texth;
boolean colorActif;
boolean mouseHover;
boolean zoomVirus;
Text(String tempw, int tempx, int tempy, int tempz,int tempxspeed) {
xspeed= tempxspeed;
w=tempw;
x=tempx;
y=tempy;
z=tempz;
}
void display() {
if (!mouseHover) {
textw= textWidth(w);
texth = textAscent() + textDescent();
fill(255);
textFont(f1, 20);
text(w, x, y,z);
}
if (colorActif) {
fill( int(random(2))*255, int(random(2))*255, int(random(2))*255);
textFont(f1, 20);
text(w, x, y,z);
}
if (zoomVirus) {
textSize(30);
//textLeading(150);
fill(0);
text(w, x, y,0);
}
}
void move() {
y=y+xspeed;
if (( y < height) && (y < 0) || (y > height) && ( y> height)) {
xspeed=-xspeed;
}
}
//interaction word dissapear
void interact() {
if (laserX > x && laserX < x+textw && laserY > y && laserY < y+texth) {
mouseHover =! mouseHover;
}
}
//interaction button color/stop and play.
void apparition() {
if (mousePressed) {
colorActif =! colorActif;
}
}
void crazy() {
if (mousePressed) {
zoomVirus =! zoomVirus;
}
}
}

View File

@@ -0,0 +1,11 @@
void replay() {
/*
instead of using loop. this way we can do stuff when the movie restarts without
nasty frame calculation or duration / time comparison (there is a movie.duration() and movie.time() function)
*/
door.stop();
if (!win) {
button[6].randomPosition();
door.play();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,32 @@
void getLaser() {
Client thisClient = myServer.available();
if (thisClient !=null) {
String whatClientSaid = thisClient.readString();
if (whatClientSaid != null) {
String[] x = splitTokens(whatClientSaid, "(), ");
//float(x[0]) = PVector1, float(x[1]) = PVector2, float(x[2]) = PVector3
try {
float p1 = float(x[0]);
float p2 = float(x[1]);
float p3 = float(x[2]);
if (p1 == 3.5) {
laserX = int(map(p3, -2.3, 2.3, width/5*2, width/5*3));
} else {
if (p3 < 0) {
laserX = int(map(p1, -3.5, 3.5, 0, width/5*2));
} else {
laserX = int(map(p1, 3.5, -3.5, width/5*3, width));
}
}
laserY = int(map(p2, 1, 4, height, 0));
laserX = int(map(constrain(laserX, 0, width),0,width,width,0));
laserY = constrain(laserY, 0, height);
println(p1, p2, p3);
}
catch(Exception e) {
}
println(laserX, laserY);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,12 @@
A button class for creating buttons with individual position, image and action.
The action to run is determined by its name.
```
Button(
int X, //x-position
int Y, //y-position
int W, //width
int H, //height
String Img, //image name (image must be in data-folder)
String WTD // what to do - every button carries all functions you want to be able to call. which function gets called is selected by the buttons name. THIS IS DIRTY, implement arraylist if you like, or some fancy case-table.. oh well
)
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,66 @@
//what does a cool button need?
//either trigger or bang
//bang: call a function on click
//trigger: toggle a boolean on click
//image
Button[] button = new Button[3];
void setup() {
size(300, 300);
button[0] = new Button(10, 10, 100, 100, "Button8.png", "print");
button[1] = new Button(200, 100, 100, 100, "Button1.png", "switchdoormovie");
button[2] = new Button(200, 100, 100, 100, "Button1.png", "toggle random movement");
fill(255);
}
void draw() {
background(0);
for (int i = 0; i < button.length; i++) {
button[i].display();
}
}
void mousePressed() {
for (int i = 0; i < button.length; i++) {
if (button[i].hover())
button[i].clicked();
}
}
class Button {
int x, y, w, h;
String WhatToDo;
PImage img;
boolean hover() {
if (mouseX > x && mouseX < x + w &&
mouseY > y && mouseY < y + h) {
return true;
} else {
return false;
}
}
Button(int X, int Y, int W, int H, String Img, String WTD) {
x = X;
y = Y;
w = W;
h = H;
img = loadImage(Img);
WhatToDo = WTD;
}
void clicked() {
if (WhatToDo.equals("color")) {
//call color functions shizzle
} else if (WhatToDo.equals("print")) {
println("Clicked!");
} else if (WhatToDo.equals("something")){
} else if (WhatToDo.equals("movieToggle5")){
// layers[5].togglePlay():
}
}
void display() {
image(img, x, y, w, h);
}
}

View File

@@ -0,0 +1 @@
Basic netsocket setup for processing. Made to receive the position of the laserpoint.

View File

@@ -0,0 +1,44 @@
import processing.net.*;
int port = 50000;
Server myServer;
void setup()
{
size(300,300);
background(0);
myServer = new Server(this, port);
}
void draw()
{
getLaser();
}
int laserX,laserY;
void getLaser() {
Client thisClient = myServer.available();
if (thisClient !=null) {
String whatClientSaid = thisClient.readString();
if (whatClientSaid != null) {
String[] x = splitTokens(whatClientSaid, "(), ");
//potentially add try and catch here if the client is not in synch
float p1 = float(x[0]);
float p2 = float(x[1]);
float p3 = float(x[2]);
if (p1 == 3.5) {
laserX = int(map(p3, -2.3, 2.3, width/5*2, width/5*3));
} else {
if (p3 < 0) {
laserX = int(map(p1, -3.5, 3.5, 0, width/5*2));
} else {
laserX = int(map(p1, 3.5, -3.5, width/5*3, width));
}
}
laserY = int(map(p2, 4, 1, 0, height));
laserX = constrain(laserX, 0, width);
laserY = constrain(laserY, 0, height);
}
}
}

View File

@@ -0,0 +1,11 @@
Processing 3 Class that renders a Movie or Image in a PGraphic, looping through each pixel, determining its brightness value.
If the brightness of a pixel is above / below a threshold, it writes a text on the pixel.
```
WordedImageLayer(
String MovName, //movie to load
String Word, //word to write on pixel
int X, //x-position of the movie on media-theatre screen
int thresh, //brightness-threshold
int Factor //level of detail - the higher, the more pixelated (less words)
)
```

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,153 @@
import processing.video.*;
PApplet app; //technically needed to create movie instances inside of a class
PImage blob;
boolean debug = false; //new: activate it to see the movies in the background
WordedImageLayer[] layers = new WordedImageLayer[7];
void movieEvent(Movie m) {
m.read();
}
void setup() {
size(1536, 230);
textAlign(CENTER);
fill(255);
blob = loadImage("blob.png");
app = this;
/* new:
you don't need to load the movie seperately from the layer-class anymore. it loads the video itself now yay :) just give the filename as first argument.
(changed first argument from Movie-type to String-type, added movie constructor to class)
*/
layers[0] = new WordedImageLayer(
"0.mov", //String, the name of the movie file we want to load in.
"word", //String, the word it should use to write over the movie.
0, //Integer, horizontal X-position. vertical position doesn't matter, the videos are always stretched over the whole height
10, //Integer, brightness-threshold. look up what a threshold is if you don't know it. min: 0, max: 255. if it's 30 it will write the word for every pixel in the video that is less bright than 30
15 //Integer, level of detail. the higher the number, the less detail
);
layers[1] = new WordedImageLayer("1.mov", "door", 1000, 40, 3);
layers[2] = new WordedImageLayer("2.mov", "a", 0, 10, 10); //new: make threshold a negative number to inverse it.
layers[3] = new WordedImageLayer("3.mov", "water", 0, 10, 4);
layers[4] = new WordedImageLayer("4.mov", "wave", 0, 100, 20);
layers[5] = new WordedImageLayer("5.mov", "smoke", 0, 200, 7);
layers[6] = new WordedImageLayer("6.mov", "smoke", 0, 200, 7);
/* new functions:
startPlaying, stopPlaying, togglePlaying
*/
layers[0].startPlaying();
// layers[1].startPlaying();
// layers[2].startPlaying();
// layers[3].startPlaying();
// layers[4].startPlaying();
// layers[5].startPlaying();
}
void draw() {
background(0);
for (int i = 0; i < layers.length; i++) {
layers[i].update();
}
}
void mousePressed() {
for (int i = 0; i < layers.length; i++) {
if (layers[i].hover()) {
println("Clicked layer " + i + "!");
//you could call the following function with a button. (are there really going to be buttons in final version?)
layers[i].togglePlaying();
}
}
}
class WordedImageLayer {
Movie sourceMovie;
PGraphics canvas;
PImage getmov;
PImage mov;
String word;
String movFileName;
boolean inverse;
boolean hover;
boolean isPlaying;
int threshold;
int detailfactor;
int movX;
int movY = 0;
int movW;
int movH;
WordedImageLayer(String MovName, String Word, int X, int thresh, int Factor) {
movFileName = MovName;
word = Word;
movX = X;
threshold = thresh;
detailfactor = Factor;
sourceMovie = new Movie(app, movFileName);
}
void startPlaying() { //new-
sourceMovie.loop();
isPlaying = true;
}
void stopPlaying() { //-functions-
sourceMovie.stop();
isPlaying = false;
}
void togglePlaying() { //-yay!
if (isPlaying)
stopPlaying();
else
startPlaying();
}
boolean hover() {
if (mouseX > movX && mouseX < movX + movW && mouseY > movY && mouseY < movY + movH)
return true;
else
return false;
}
void update() {
if (isPlaying) { //new! check if isplaying. so you can just keep the for loops that update every video. it will break here if the video shall not be running.
try {
mov = sourceMovie.get();
mov.resize(0, height);
movW = mov.width;
movH = mov.height;
canvas = createGraphics(movW, movH);
canvas.beginDraw();
canvas.imageMode(CORNER);
canvas.image(mov, 0, 0, canvas.width, canvas.height);
canvas.imageMode(CENTER);
canvas.image(blob, mouseX-movX, mouseY, height/3, height/3);
mov = canvas.get();
canvas.endDraw();
mov.resize(0, height/detailfactor);
if (debug) {
tint(255, 60);
image(canvas, movX, 0);
tint(255, 255);
}
mov.loadPixels();
for (int i=0; i<mov.pixels.length; i++ ) {
int col = mov.pixels[i];
if (brightness(col) > threshold) {
//int x = i%mov.width*detailfactor;
int x = int(map(i%mov.width*detailfactor, 0, mov.width, 0, movW/detailfactor)); //new! fixes a bug where the cursor was out of place
int y = i/mov.width*detailfactor+10;
text(word, x+movX, y);
}
}
}
catch (Exception e) {
}
}
}
}

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# Find-the-Door
Game for Fun Palace

Binary file not shown.

BIN
Unity/.vs/Unity/v14/.suo Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<RootNamespace></RootNamespace>
<ProjectGuid>{1A2D5028-442C-2587-B143-7CECC2B8AC9B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Assembly-CSharp-Editor</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseDirectory>Assets</BaseDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_0;UNITY_5_5;UNITY_5;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Temp\bin\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\SteamVR\Editor\SteamVR_Editor.cs" />
<Compile Include="Assets\SteamVR\Editor\SteamVR_RenderModelEditor.cs" />
<Compile Include="Assets\SteamVR\Editor\SteamVR_Settings.cs" />
<Compile Include="Assets\SteamVR\Editor\SteamVR_SkyboxEditor.cs" />
<Compile Include="Assets\SteamVR\Editor\SteamVR_Update.cs" />
<None Include="Assets\SteamVR\Resources\SteamVR_Fade.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_ClearAll.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Hints\Shaders\ControllerButtonHints.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Teleport\Shaders\Highlight.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_SphericalProjection.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_AlphaOut.shader" />
<None Include="Assets\SteamVR\readme.txt" />
<None Include="Assets\SteamVR\InteractionSystem\Core\Shaders\Silhouette.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_ColorOut.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Core\Shaders\SeeThru.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Readme_InteractionSystem.txt" />
<Reference Include="UnityEditor.Advertisements">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/Editor/UnityEditor.Advertisements.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/EditorTestsRunner/Editor/nunit.framework.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.EditorTestsRunner">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/EditorTestsRunner/Editor/UnityEditor.EditorTestsRunner.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.UI">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Networking">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.PlaymodeTestsRunner">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/PlaymodeTestsRunner/Editor/UnityEditor.PlaymodeTestsRunner.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PlaymodeTestsRunner">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/PlaymodeTestsRunner/UnityEngine.PlaymodeTestsRunner.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.TreeEditor">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Analytics">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/Editor/UnityEditor.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.HoloLens">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Editor/UnityEditor.HoloLens.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.HoloLens">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.VR">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VR">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/RuntimeEditor/UnityEngine.VR.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Graphs">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Assembly-CSharp.csproj">
<Project>{06CC2B1B-B526-7801-AF2F-99A643C8309A}</Project> <Name>Assembly-CSharp</Name> </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<RootNamespace></RootNamespace>
<ProjectGuid>{06CC2B1B-B526-7801-AF2F-99A643C8309A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Assembly-CSharp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseDirectory>Assets</BaseDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_0;UNITY_5_5;UNITY_5;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Temp\bin\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\SteamVR\Extras\SteamVR_GazeTracker.cs" />
<Compile Include="Assets\SteamVR\Extras\SteamVR_LaserPointer.cs" />
<Compile Include="Assets\SteamVR\Extras\SteamVR_Teleporter.cs" />
<Compile Include="Assets\SteamVR\Extras\SteamVR_TestThrow.cs" />
<Compile Include="Assets\SteamVR\Extras\SteamVR_TestTrackedCamera.cs" />
<Compile Include="Assets\SteamVR\Extras\SteamVR_TrackedController.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\BodyCollider.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\CircularDrive.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\ComplexThrowable.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\ControllerHoverHighlight.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\CustomEvents.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\DebugUI.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\DestroyOnDetachedFromHand.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\DestroyOnParticleSystemDeath.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\DestroyOnTriggerEnter.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\DistanceHaptics.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\DontDestroyOnLoad.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\EnumFlags.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\FallbackCameraController.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\Hand.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\HapticRack.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\HideOnHandFocusLost.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\IgnoreHovering.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\InputModule.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\Interactable.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\InteractableButtonEvents.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\InteractableHoverEvents.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\ItemPackage.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\ItemPackageReference.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\ItemPackageSpawner.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearAnimation.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearAnimator.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearAudioPitch.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearBlendshape.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearDisplacement.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearDrive.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\LinearMapping.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\PlaySound.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\Player.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SeeThru.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SleepOnAwake.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SoundDeparent.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SoundPlayOneshot.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SpawnAndAttachAfterControllerIsTracking.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SpawnAndAttachToHand.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\SpawnRenderModel.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\Throwable.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\UIElement.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\Unparent.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\Util.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Core\Scripts\VelocityEstimator.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Hints\Scripts\ControllerButtonHints.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\ArcheryTarget.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\Arrow.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\ArrowHand.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\ArrowheadRotation.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\Balloon.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\BalloonColliders.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\BalloonHapticBump.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\BalloonSpawner.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\ExplosionWobble.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\FireSource.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\Longbow.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Longbow\Scripts\SoundBowClick.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Samples\Scripts\ControllerHintsExample.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Samples\Scripts\InteractableExample.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\AllowTeleportWhileAttachedToHand.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\ChaperoneInfo.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\IgnoreTeleportTrace.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\Teleport.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportArc.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportArea.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportMarkerBase.cs" />
<Compile Include="Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportPoint.cs" />
<Compile Include="Assets\SteamVR\Plugins\openvr_api.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Camera.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_CameraFlip.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_CameraMask.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Controller.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_ControllerManager.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Ears.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Events.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_ExternalCamera.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Fade.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Frustum.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_GameView.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_IK.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_LoadLevel.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Menu.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Overlay.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_PlayArea.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Render.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_RenderModel.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Skybox.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_SphericalProjection.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Stats.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_TestController.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_TrackedCamera.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_TrackedObject.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_UpdatePoses.cs" />
<Compile Include="Assets\SteamVR\Scripts\SteamVR_Utils.cs" />
<Compile Include="Assets\ViveLaserPointer.cs" />
<Compile Include="Assets\networkSocket.cs" />
<None Include="Assets\SteamVR\Resources\SteamVR_Fade.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_ClearAll.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Hints\Shaders\ControllerButtonHints.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Teleport\Shaders\Highlight.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_SphericalProjection.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_AlphaOut.shader" />
<None Include="Assets\SteamVR\readme.txt" />
<None Include="Assets\SteamVR\InteractionSystem\Core\Shaders\Silhouette.shader" />
<None Include="Assets\SteamVR\Resources\SteamVR_ColorOut.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Core\Shaders\SeeThru.shader" />
<None Include="Assets\SteamVR\InteractionSystem\Readme_InteractionSystem.txt" />
<Reference Include="UnityEngine.UI">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PlaymodeTestsRunner">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/PlaymodeTestsRunner/UnityEngine.PlaymodeTestsRunner.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.HoloLens">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VR">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/RuntimeEditor/UnityEngine.VR.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

7
Unity/Assets/Scenes.meta Normal file
View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a8a7ba0a9db49da4f82473c51c9cb8f4
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c46b5d37e9beda4092bb579be8aafc2
timeCreated: 1485427390
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 17fdbdac4774fcf49b911cb9fb795b21
folderAsset: yes
timeCreated: 1485425910
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: c33af0785775d7548b22541da37936fe
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:

View File

@@ -0,0 +1,127 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Camera
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
[CustomEditor(typeof(SteamVR_Camera)), CanEditMultipleObjects]
public class SteamVR_Editor : Editor
{
int bannerHeight = 150;
Texture logo;
SerializedProperty script, wireframe;
string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}
void OnEnable()
{
var resourcePath = GetResourcePath();
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
script = serializedObject.FindProperty("m_Script");
wireframe = serializedObject.FindProperty("wireframe");
foreach (SteamVR_Camera target in targets)
target.ForceLast();
}
public override void OnInspectorGUI()
{
serializedObject.Update();
var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
if (!Application.isPlaying)
{
var expand = false;
var collapse = false;
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
collapse = true;
else
expand = true;
}
if (expand)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Expand"))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (!target.isExpanded)
{
target.Expand();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
if (collapse)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Collapse"))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
{
target.Collapse();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
}
EditorGUILayout.PropertyField(script);
EditorGUILayout.PropertyField(wireframe);
serializedObject.ApplyModifiedProperties();
}
public static void ExportPackage()
{
AssetDatabase.ExportPackage(new string[] {
"Assets/SteamVR",
"Assets/Plugins/openvr_api.cs",
"Assets/Plugins/openvr_api.bundle",
"Assets/Plugins/x86/openvr_api.dll",
"Assets/Plugins/x86/steam_api.dll",
"Assets/Plugins/x86/libsteam_api.so",
"Assets/Plugins/x86_64/openvr_api.dll",
"Assets/Plugins/x86_64/steam_api.dll",
"Assets/Plugins/x86_64/libsteam_api.so",
"Assets/Plugins/x86_64/libopenvr_api.so",
}, "steamvr.unitypackage", ExportPackageOptions.Recurse);
EditorApplication.Exit(0);
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5ba22c80948c94e44a82b9fd1b3abd0d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:

View File

@@ -0,0 +1,105 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_RenderModel
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections.Generic;
using Valve.VR;
[CustomEditor(typeof(SteamVR_RenderModel)), CanEditMultipleObjects]
public class SteamVR_RenderModelEditor : Editor
{
SerializedProperty script, index, modelOverride, shader, verbose, createComponents, updateDynamically;
static string[] renderModelNames;
int renderModelIndex;
void OnEnable()
{
script = serializedObject.FindProperty("m_Script");
index = serializedObject.FindProperty("index");
modelOverride = serializedObject.FindProperty("modelOverride");
shader = serializedObject.FindProperty("shader");
verbose = serializedObject.FindProperty("verbose");
createComponents = serializedObject.FindProperty("createComponents");
updateDynamically = serializedObject.FindProperty("updateDynamically");
// Load render model names if necessary.
if (renderModelNames == null)
{
renderModelNames = LoadRenderModelNames();
}
// Update renderModelIndex based on current modelOverride value.
if (modelOverride.stringValue != "")
{
for (int i = 0; i < renderModelNames.Length; i++)
{
if (modelOverride.stringValue == renderModelNames[i])
{
renderModelIndex = i;
break;
}
}
}
}
static string[] LoadRenderModelNames()
{
var results = new List<string>();
results.Add("None");
using (var holder = new SteamVR_RenderModel.RenderModelInterfaceHolder())
{
var renderModels = holder.instance;
if (renderModels != null)
{
uint count = renderModels.GetRenderModelCount();
for (uint i = 0; i < count; i++)
{
var buffer = new StringBuilder();
var requiredSize = renderModels.GetRenderModelName(i, buffer, 0);
if (requiredSize == 0)
continue;
buffer.EnsureCapacity((int)requiredSize);
renderModels.GetRenderModelName(i, buffer, requiredSize);
results.Add(buffer.ToString());
}
}
}
return results.ToArray();
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(script);
EditorGUILayout.PropertyField(index);
//EditorGUILayout.PropertyField(modelOverride);
GUILayout.BeginHorizontal();
GUILayout.Label("Model Override");
var selected = EditorGUILayout.Popup(renderModelIndex, renderModelNames);
if (selected != renderModelIndex)
{
renderModelIndex = selected;
modelOverride.stringValue = (selected > 0) ? renderModelNames[selected] : "";
}
GUILayout.EndHorizontal();
EditorGUILayout.PropertyField(shader);
EditorGUILayout.PropertyField(verbose);
EditorGUILayout.PropertyField(createComponents);
EditorGUILayout.PropertyField(updateDynamically);
serializedObject.ApplyModifiedProperties();
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 67867a20919f7db45a2e7034fda1c28e
timeCreated: 1433373945
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,685 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Prompt developers to use settings most compatible with SteamVR.
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
[InitializeOnLoad]
public class SteamVR_Settings : EditorWindow
{
const bool forceShow = false; // Set to true to get the dialog to show back up in the case you clicked Ignore All.
const string ignore = "ignore.";
const string useRecommended = "Use recommended ({0})";
const string currentValue = " (current = {0})";
const string buildTarget = "Build Target";
const string showUnitySplashScreen = "Show Unity Splashscreen";
const string defaultIsFullScreen = "Default is Fullscreen";
const string defaultScreenSize = "Default Screen Size";
const string runInBackground = "Run In Background";
const string displayResolutionDialog = "Display Resolution Dialog";
const string resizableWindow = "Resizable Window";
const string fullscreenMode = "D3D11 Fullscreen Mode";
const string visibleInBackground = "Visible In Background";
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
const string renderingPath = "Rendering Path";
#endif
const string colorSpace = "Color Space";
const string gpuSkinning = "GPU Skinning";
#if false // skyboxes are currently broken
const string singlePassStereoRendering = "Single-Pass Stereo Rendering";
#endif
const BuildTarget recommended_BuildTarget = BuildTarget.StandaloneWindows64;
const bool recommended_ShowUnitySplashScreen = false;
const bool recommended_DefaultIsFullScreen = false;
const int recommended_DefaultScreenWidth = 1024;
const int recommended_DefaultScreenHeight = 768;
const bool recommended_RunInBackground = true;
const ResolutionDialogSetting recommended_DisplayResolutionDialog = ResolutionDialogSetting.HiddenByDefault;
const bool recommended_ResizableWindow = true;
const D3D11FullscreenMode recommended_FullscreenMode = D3D11FullscreenMode.FullscreenWindow;
const bool recommended_VisibleInBackground = true;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
const RenderingPath recommended_RenderPath = RenderingPath.Forward;
#endif
const ColorSpace recommended_ColorSpace = ColorSpace.Linear;
const bool recommended_GpuSkinning = true;
#if false
const bool recommended_SinglePassStereoRendering = true;
#endif
static SteamVR_Settings window;
static SteamVR_Settings()
{
EditorApplication.update += Update;
}
static void Update()
{
bool show =
(!EditorPrefs.HasKey(ignore + buildTarget) &&
EditorUserBuildSettings.activeBuildTarget != recommended_BuildTarget) ||
(!EditorPrefs.HasKey(ignore + showUnitySplashScreen) &&
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
PlayerSettings.showUnitySplashScreen != recommended_ShowUnitySplashScreen) ||
#else
PlayerSettings.SplashScreen.show != recommended_ShowUnitySplashScreen) ||
#endif
(!EditorPrefs.HasKey(ignore + defaultIsFullScreen) &&
PlayerSettings.defaultIsFullScreen != recommended_DefaultIsFullScreen) ||
(!EditorPrefs.HasKey(ignore + defaultScreenSize) &&
(PlayerSettings.defaultScreenWidth != recommended_DefaultScreenWidth ||
PlayerSettings.defaultScreenHeight != recommended_DefaultScreenHeight)) ||
(!EditorPrefs.HasKey(ignore + runInBackground) &&
PlayerSettings.runInBackground != recommended_RunInBackground) ||
(!EditorPrefs.HasKey(ignore + displayResolutionDialog) &&
PlayerSettings.displayResolutionDialog != recommended_DisplayResolutionDialog) ||
(!EditorPrefs.HasKey(ignore + resizableWindow) &&
PlayerSettings.resizableWindow != recommended_ResizableWindow) ||
(!EditorPrefs.HasKey(ignore + fullscreenMode) &&
PlayerSettings.d3d11FullscreenMode != recommended_FullscreenMode) ||
(!EditorPrefs.HasKey(ignore + visibleInBackground) &&
PlayerSettings.visibleInBackground != recommended_VisibleInBackground) ||
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
(!EditorPrefs.HasKey(ignore + renderingPath) &&
PlayerSettings.renderingPath != recommended_RenderPath) ||
#endif
(!EditorPrefs.HasKey(ignore + colorSpace) &&
PlayerSettings.colorSpace != recommended_ColorSpace) ||
(!EditorPrefs.HasKey(ignore + gpuSkinning) &&
PlayerSettings.gpuSkinning != recommended_GpuSkinning) ||
#if false
(!EditorPrefs.HasKey(ignore + singlePassStereoRendering) &&
PlayerSettings.singlePassStereoRendering != recommended_SinglePassStereoRendering) ||
#endif
forceShow;
if (show)
{
window = GetWindow<SteamVR_Settings>(true);
window.minSize = new Vector2(320, 440);
//window.title = "SteamVR";
}
// Switch to native OpenVR support.
var updated = false;
if (!PlayerSettings.virtualRealitySupported)
{
PlayerSettings.virtualRealitySupported = true;
updated = true;
}
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevices(BuildTargetGroup.Standalone);
#else
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone);
#endif
var hasOpenVR = false;
foreach (var device in devices)
if (device.ToLower() == "openvr")
hasOpenVR = true;
if (!hasOpenVR)
{
string[] newDevices;
if (updated)
{
newDevices = new string[] { "OpenVR" };
}
else
{
newDevices = new string[devices.Length + 1];
for (int i = 0; i < devices.Length; i++)
newDevices[i] = devices[i];
newDevices[devices.Length] = "OpenVR";
updated = true;
}
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
UnityEditorInternal.VR.VREditor.SetVREnabledDevices(BuildTargetGroup.Standalone, newDevices);
#else
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone, newDevices);
#endif
}
if (updated)
Debug.Log("Switching to native OpenVR support.");
var dlls = new string[]
{
"Plugins/x86/openvr_api.dll",
"Plugins/x86_64/openvr_api.dll"
};
foreach (var path in dlls)
{
if (!File.Exists(Application.dataPath + "/" + path))
continue;
if (AssetDatabase.DeleteAsset("Assets/" + path))
Debug.Log("Deleting " + path);
else
{
Debug.Log(path + " in use; cannot delete. Please restart Unity to complete upgrade.");
}
}
EditorApplication.update -= Update;
}
Vector2 scrollPosition;
bool toggleState;
string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}
public void OnGUI()
{
var resourcePath = GetResourcePath();
var logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
var rect = GUILayoutUtility.GetRect(position.width, 150, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
EditorGUILayout.HelpBox("Recommended project settings for SteamVR:", MessageType.Warning);
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
int numItems = 0;
if (!EditorPrefs.HasKey(ignore + buildTarget) &&
EditorUserBuildSettings.activeBuildTarget != recommended_BuildTarget)
{
++numItems;
GUILayout.Label(buildTarget + string.Format(currentValue, EditorUserBuildSettings.activeBuildTarget));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_BuildTarget)))
{
#if (UNITY_5_5 || UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
EditorUserBuildSettings.SwitchActiveBuildTarget(recommended_BuildTarget);
#else
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, recommended_BuildTarget);
#endif
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + buildTarget, true);
}
GUILayout.EndHorizontal();
}
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (!EditorPrefs.HasKey(ignore + showUnitySplashScreen) &&
PlayerSettings.showUnitySplashScreen != recommended_ShowUnitySplashScreen)
{
++numItems;
GUILayout.Label(showUnitySplashScreen + string.Format(currentValue, PlayerSettings.showUnitySplashScreen));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ShowUnitySplashScreen)))
{
PlayerSettings.showUnitySplashScreen = recommended_ShowUnitySplashScreen;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + showUnitySplashScreen, true);
}
GUILayout.EndHorizontal();
}
#else
if (!EditorPrefs.HasKey(ignore + showUnitySplashScreen) &&
PlayerSettings.SplashScreen.show != recommended_ShowUnitySplashScreen)
{
++numItems;
GUILayout.Label(showUnitySplashScreen + string.Format(currentValue, PlayerSettings.SplashScreen.show));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ShowUnitySplashScreen)))
{
PlayerSettings.SplashScreen.show = recommended_ShowUnitySplashScreen;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + showUnitySplashScreen, true);
}
GUILayout.EndHorizontal();
}
#endif
if (!EditorPrefs.HasKey(ignore + defaultIsFullScreen) &&
PlayerSettings.defaultIsFullScreen != recommended_DefaultIsFullScreen)
{
++numItems;
GUILayout.Label(defaultIsFullScreen + string.Format(currentValue, PlayerSettings.defaultIsFullScreen));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_DefaultIsFullScreen)))
{
PlayerSettings.defaultIsFullScreen = recommended_DefaultIsFullScreen;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + defaultIsFullScreen, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + defaultScreenSize) &&
(PlayerSettings.defaultScreenWidth != recommended_DefaultScreenWidth ||
PlayerSettings.defaultScreenHeight != recommended_DefaultScreenHeight))
{
++numItems;
GUILayout.Label(defaultScreenSize + string.Format(" ({0}x{1})", PlayerSettings.defaultScreenWidth, PlayerSettings.defaultScreenHeight));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format("Use recommended ({0}x{1})", recommended_DefaultScreenWidth, recommended_DefaultScreenHeight)))
{
PlayerSettings.defaultScreenWidth = recommended_DefaultScreenWidth;
PlayerSettings.defaultScreenHeight = recommended_DefaultScreenHeight;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + defaultScreenSize, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + runInBackground) &&
PlayerSettings.runInBackground != recommended_RunInBackground)
{
++numItems;
GUILayout.Label(runInBackground + string.Format(currentValue, PlayerSettings.runInBackground));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_RunInBackground)))
{
PlayerSettings.runInBackground = recommended_RunInBackground;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + runInBackground, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + displayResolutionDialog) &&
PlayerSettings.displayResolutionDialog != recommended_DisplayResolutionDialog)
{
++numItems;
GUILayout.Label(displayResolutionDialog + string.Format(currentValue, PlayerSettings.displayResolutionDialog));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_DisplayResolutionDialog)))
{
PlayerSettings.displayResolutionDialog = recommended_DisplayResolutionDialog;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + displayResolutionDialog, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + resizableWindow) &&
PlayerSettings.resizableWindow != recommended_ResizableWindow)
{
++numItems;
GUILayout.Label(resizableWindow + string.Format(currentValue, PlayerSettings.resizableWindow));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ResizableWindow)))
{
PlayerSettings.resizableWindow = recommended_ResizableWindow;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + resizableWindow, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + fullscreenMode) &&
PlayerSettings.d3d11FullscreenMode != recommended_FullscreenMode)
{
++numItems;
GUILayout.Label(fullscreenMode + string.Format(currentValue, PlayerSettings.d3d11FullscreenMode));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_FullscreenMode)))
{
PlayerSettings.d3d11FullscreenMode = recommended_FullscreenMode;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + fullscreenMode, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + visibleInBackground) &&
PlayerSettings.visibleInBackground != recommended_VisibleInBackground)
{
++numItems;
GUILayout.Label(visibleInBackground + string.Format(currentValue, PlayerSettings.visibleInBackground));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_VisibleInBackground)))
{
PlayerSettings.visibleInBackground = recommended_VisibleInBackground;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + visibleInBackground, true);
}
GUILayout.EndHorizontal();
}
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (!EditorPrefs.HasKey(ignore + renderingPath) &&
PlayerSettings.renderingPath != recommended_RenderPath)
{
++numItems;
GUILayout.Label(renderingPath + string.Format(currentValue, PlayerSettings.renderingPath));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_RenderPath) + " - required for MSAA"))
{
PlayerSettings.renderingPath = recommended_RenderPath;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + renderingPath, true);
}
GUILayout.EndHorizontal();
}
#endif
if (!EditorPrefs.HasKey(ignore + colorSpace) &&
PlayerSettings.colorSpace != recommended_ColorSpace)
{
++numItems;
GUILayout.Label(colorSpace + string.Format(currentValue, PlayerSettings.colorSpace));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ColorSpace) + " - requires reloading scene"))
{
PlayerSettings.colorSpace = recommended_ColorSpace;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + colorSpace, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + gpuSkinning) &&
PlayerSettings.gpuSkinning != recommended_GpuSkinning)
{
++numItems;
GUILayout.Label(gpuSkinning + string.Format(currentValue, PlayerSettings.gpuSkinning));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_GpuSkinning)))
{
PlayerSettings.gpuSkinning = recommended_GpuSkinning;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + gpuSkinning, true);
}
GUILayout.EndHorizontal();
}
#if false
if (!EditorPrefs.HasKey(ignore + singlePassStereoRendering) &&
PlayerSettings.singlePassStereoRendering != recommended_SinglePassStereoRendering)
{
++numItems;
GUILayout.Label(singlePassStereoRendering + string.Format(currentValue, PlayerSettings.singlePassStereoRendering));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_SinglePassStereoRendering)))
{
PlayerSettings.singlePassStereoRendering = recommended_SinglePassStereoRendering;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + singlePassStereoRendering, true);
}
GUILayout.EndHorizontal();
}
#endif
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Clear All Ignores"))
{
EditorPrefs.DeleteKey(ignore + buildTarget);
EditorPrefs.DeleteKey(ignore + showUnitySplashScreen);
EditorPrefs.DeleteKey(ignore + defaultIsFullScreen);
EditorPrefs.DeleteKey(ignore + defaultScreenSize);
EditorPrefs.DeleteKey(ignore + runInBackground);
EditorPrefs.DeleteKey(ignore + displayResolutionDialog);
EditorPrefs.DeleteKey(ignore + resizableWindow);
EditorPrefs.DeleteKey(ignore + fullscreenMode);
EditorPrefs.DeleteKey(ignore + visibleInBackground);
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
EditorPrefs.DeleteKey(ignore + renderingPath);
#endif
EditorPrefs.DeleteKey(ignore + colorSpace);
EditorPrefs.DeleteKey(ignore + gpuSkinning);
#if false
EditorPrefs.DeleteKey(ignore + singlePassStereoRendering);
#endif
}
GUILayout.EndHorizontal();
GUILayout.EndScrollView();
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
if (numItems > 0)
{
if (GUILayout.Button("Accept All"))
{
// Only set those that have not been explicitly ignored.
if (!EditorPrefs.HasKey(ignore + buildTarget))
#if (UNITY_5_5 || UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
EditorUserBuildSettings.SwitchActiveBuildTarget(recommended_BuildTarget);
#else
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, recommended_BuildTarget);
#endif
if (!EditorPrefs.HasKey(ignore + showUnitySplashScreen))
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
PlayerSettings.showUnitySplashScreen = recommended_ShowUnitySplashScreen;
#else
PlayerSettings.SplashScreen.show = recommended_ShowUnitySplashScreen;
#endif
if (!EditorPrefs.HasKey(ignore + defaultIsFullScreen))
PlayerSettings.defaultIsFullScreen = recommended_DefaultIsFullScreen;
if (!EditorPrefs.HasKey(ignore + defaultScreenSize))
{
PlayerSettings.defaultScreenWidth = recommended_DefaultScreenWidth;
PlayerSettings.defaultScreenHeight = recommended_DefaultScreenHeight;
}
if (!EditorPrefs.HasKey(ignore + runInBackground))
PlayerSettings.runInBackground = recommended_RunInBackground;
if (!EditorPrefs.HasKey(ignore + displayResolutionDialog))
PlayerSettings.displayResolutionDialog = recommended_DisplayResolutionDialog;
if (!EditorPrefs.HasKey(ignore + resizableWindow))
PlayerSettings.resizableWindow = recommended_ResizableWindow;
if (!EditorPrefs.HasKey(ignore + fullscreenMode))
PlayerSettings.d3d11FullscreenMode = recommended_FullscreenMode;
if (!EditorPrefs.HasKey(ignore + visibleInBackground))
PlayerSettings.visibleInBackground = recommended_VisibleInBackground;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (!EditorPrefs.HasKey(ignore + renderingPath))
PlayerSettings.renderingPath = recommended_RenderPath;
#endif
if (!EditorPrefs.HasKey(ignore + colorSpace))
PlayerSettings.colorSpace = recommended_ColorSpace;
if (!EditorPrefs.HasKey(ignore + gpuSkinning))
PlayerSettings.gpuSkinning = recommended_GpuSkinning;
#if false
if (!EditorPrefs.HasKey(ignore + singlePassStereoRendering))
PlayerSettings.singlePassStereoRendering = recommended_SinglePassStereoRendering;
#endif
EditorUtility.DisplayDialog("Accept All", "You made the right choice!", "Ok");
Close();
}
if (GUILayout.Button("Ignore All"))
{
if (EditorUtility.DisplayDialog("Ignore All", "Are you sure?", "Yes, Ignore All", "Cancel"))
{
// Only ignore those that do not currently match our recommended settings.
if (EditorUserBuildSettings.activeBuildTarget != recommended_BuildTarget)
EditorPrefs.SetBool(ignore + buildTarget, true);
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (PlayerSettings.showUnitySplashScreen != recommended_ShowUnitySplashScreen)
#else
if (PlayerSettings.SplashScreen.show != recommended_ShowUnitySplashScreen)
#endif
EditorPrefs.SetBool(ignore + showUnitySplashScreen, true);
if (PlayerSettings.defaultIsFullScreen != recommended_DefaultIsFullScreen)
EditorPrefs.SetBool(ignore + defaultIsFullScreen, true);
if (PlayerSettings.defaultScreenWidth != recommended_DefaultScreenWidth ||
PlayerSettings.defaultScreenHeight != recommended_DefaultScreenHeight)
EditorPrefs.SetBool(ignore + defaultScreenSize, true);
if (PlayerSettings.runInBackground != recommended_RunInBackground)
EditorPrefs.SetBool(ignore + runInBackground, true);
if (PlayerSettings.displayResolutionDialog != recommended_DisplayResolutionDialog)
EditorPrefs.SetBool(ignore + displayResolutionDialog, true);
if (PlayerSettings.resizableWindow != recommended_ResizableWindow)
EditorPrefs.SetBool(ignore + resizableWindow, true);
if (PlayerSettings.d3d11FullscreenMode != recommended_FullscreenMode)
EditorPrefs.SetBool(ignore + fullscreenMode, true);
if (PlayerSettings.visibleInBackground != recommended_VisibleInBackground)
EditorPrefs.SetBool(ignore + visibleInBackground, true);
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (PlayerSettings.renderingPath != recommended_RenderPath)
EditorPrefs.SetBool(ignore + renderingPath, true);
#endif
if (PlayerSettings.colorSpace != recommended_ColorSpace)
EditorPrefs.SetBool(ignore + colorSpace, true);
if (PlayerSettings.gpuSkinning != recommended_GpuSkinning)
EditorPrefs.SetBool(ignore + gpuSkinning, true);
#if false
if (PlayerSettings.singlePassStereoRendering != recommended_SinglePassStereoRendering)
EditorPrefs.SetBool(ignore + singlePassStereoRendering, true);
#endif
Close();
}
}
}
else if (GUILayout.Button("Close"))
{
Close();
}
GUILayout.EndHorizontal();
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d2244eee8a3a4784fb40d1123ff69301
timeCreated: 1438809573
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,381 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Skybox
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections.Generic;
using Valve.VR;
using System.IO;
[CustomEditor(typeof(SteamVR_Skybox)), CanEditMultipleObjects]
public class SteamVR_SkyboxEditor : Editor
{
private const string nameFormat = "{0}/{1}-{2}.png";
private const string helpText = "Take snapshot will use the current " +
"position and rotation to capture six directional screenshots to use as this " +
"skybox's textures. Note: This skybox is only used to override what shows up " +
"in the compositor (e.g. when loading levels). Add a Camera component to this " +
"object to override default settings like which layers to render. Additionally, " +
"by specifying your own targetTexture, you can control the size of the textures " +
"and other properties like antialiasing. Don't forget to disable the camera.\n\n" +
"For stereo screenshots, a panorama is render for each eye using the specified " +
"ipd (in millimeters) broken up into segments cellSize pixels square to optimize " +
"generation.\n(32x32 takes about 10 seconds depending on scene complexity, 16x16 " +
"takes around a minute, while will 8x8 take several minutes.)\n\nTo test, hit " +
"play then pause - this will activate the skybox settings, and then drop you to " +
"the compositor where the skybox is rendered.";
public override void OnInspectorGUI()
{
DrawDefaultInspector();
EditorGUILayout.HelpBox(helpText, MessageType.Info);
if (GUILayout.Button("Take snapshot"))
{
var directions = new Quaternion[] {
Quaternion.LookRotation(Vector3.forward),
Quaternion.LookRotation(Vector3.back),
Quaternion.LookRotation(Vector3.left),
Quaternion.LookRotation(Vector3.right),
Quaternion.LookRotation(Vector3.up, Vector3.back),
Quaternion.LookRotation(Vector3.down, Vector3.forward)
};
Camera tempCamera = null;
foreach (SteamVR_Skybox target in targets)
{
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
if (!AssetDatabase.IsValidFolder(assetPath))
{
var guid = AssetDatabase.CreateFolder(scenePath, sceneName);
assetPath = AssetDatabase.GUIDToAssetPath(guid);
}
var camera = target.GetComponent<Camera>();
if (camera == null)
{
if (tempCamera == null)
tempCamera = new GameObject().AddComponent<Camera>();
camera = tempCamera;
}
var targetTexture = camera.targetTexture;
if (camera.targetTexture == null)
{
targetTexture = new RenderTexture(1024, 1024, 24);
targetTexture.antiAliasing = 8;
camera.targetTexture = targetTexture;
}
var oldPosition = target.transform.localPosition;
var oldRotation = target.transform.localRotation;
var baseRotation = target.transform.rotation;
var t = camera.transform;
t.position = target.transform.position;
camera.orthographic = false;
camera.fieldOfView = 90;
for (int i = 0; i < directions.Length; i++)
{
t.rotation = baseRotation * directions[i];
camera.Render();
// Copy to texture and save to disk.
RenderTexture.active = targetTexture;
var texture = new Texture2D(targetTexture.width, targetTexture.height, TextureFormat.ARGB32, false);
texture.ReadPixels(new Rect(0, 0, texture.width, texture.height), 0, 0);
texture.Apply();
RenderTexture.active = null;
var assetName = string.Format(nameFormat, assetPath, target.name, i);
System.IO.File.WriteAllBytes(assetName, texture.EncodeToPNG());
}
if (camera != tempCamera)
{
target.transform.localPosition = oldPosition;
target.transform.localRotation = oldRotation;
}
}
if (tempCamera != null)
{
Object.DestroyImmediate(tempCamera.gameObject);
}
// Now that everything has be written out, reload the associated assets and assign them.
AssetDatabase.Refresh();
foreach (SteamVR_Skybox target in targets)
{
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
for (int i = 0; i < directions.Length; i++)
{
var assetName = string.Format(nameFormat, assetPath, target.name, i);
var importer = AssetImporter.GetAtPath(assetName) as TextureImporter;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
importer.textureFormat = TextureImporterFormat.RGB24;
#else
importer.textureCompression = TextureImporterCompression.Uncompressed;
#endif
importer.wrapMode = TextureWrapMode.Clamp;
importer.mipmapEnabled = false;
importer.SaveAndReimport();
var texture = AssetDatabase.LoadAssetAtPath<Texture>(assetName);
target.SetTextureByIndex(i, texture);
}
}
}
else if (GUILayout.Button("Take stereo snapshot"))
{
const int width = 4096;
const int height = width / 2;
const int halfHeight = height / 2;
var textures = new Texture2D[] {
new Texture2D(width, height, TextureFormat.ARGB32, false),
new Texture2D(width, height, TextureFormat.ARGB32, false) };
var timer = new System.Diagnostics.Stopwatch();
Camera tempCamera = null;
foreach (SteamVR_Skybox target in targets)
{
timer.Start();
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
if (!AssetDatabase.IsValidFolder(assetPath))
{
var guid = AssetDatabase.CreateFolder(scenePath, sceneName);
assetPath = AssetDatabase.GUIDToAssetPath(guid);
}
var camera = target.GetComponent<Camera>();
if (camera == null)
{
if (tempCamera == null)
tempCamera = new GameObject().AddComponent<Camera>();
camera = tempCamera;
}
var fx = camera.gameObject.AddComponent<SteamVR_SphericalProjection>();
var oldTargetTexture = camera.targetTexture;
var oldOrthographic = camera.orthographic;
var oldFieldOfView = camera.fieldOfView;
var oldAspect = camera.aspect;
var oldPosition = target.transform.localPosition;
var oldRotation = target.transform.localRotation;
var basePosition = target.transform.position;
var baseRotation = target.transform.rotation;
var transform = camera.transform;
int cellSize = int.Parse(target.StereoCellSize.ToString().Substring(1));
float ipd = target.StereoIpdMm / 1000.0f;
int vTotal = halfHeight / cellSize;
float dv = 90.0f / vTotal; // vertical degrees per segment
float dvHalf = dv / 2.0f;
var targetTexture = new RenderTexture(cellSize, cellSize, 24);
targetTexture.wrapMode = TextureWrapMode.Clamp;
targetTexture.antiAliasing = 8;
camera.fieldOfView = dv;
camera.orthographic = false;
camera.targetTexture = targetTexture;
// Render sections of a sphere using a rectilinear projection
// and resample using a sphereical projection into a single panorama
// texture per eye. We break into sections in order to keep the eye
// separation similar around the sphere. Rendering alternates between
// top and bottom sections, sweeping horizontally around the sphere,
// alternating left and right eyes.
for (int v = 0; v < vTotal; v++)
{
var pitch = 90.0f - (v * dv) - dvHalf;
var uTotal = width / targetTexture.width;
var du = 360.0f / uTotal; // horizontal degrees per segment
var duHalf = du / 2.0f;
var vTarget = v * halfHeight / vTotal;
for (int i = 0; i < 2; i++) // top, bottom
{
if (i == 1)
{
pitch = -pitch;
vTarget = height - vTarget - cellSize;
}
for (int u = 0; u < uTotal; u++)
{
var yaw = -180.0f + (u * du) + duHalf;
var uTarget = u * width / uTotal;
var xOffset = -ipd / 2 * Mathf.Cos(pitch * Mathf.Deg2Rad);
for (int j = 0; j < 2; j++) // left, right
{
var texture = textures[j];
if (j == 1)
{
xOffset = -xOffset;
}
var offset = baseRotation * Quaternion.Euler(0, yaw, 0) * new Vector3(xOffset, 0, 0);
transform.position = basePosition + offset;
var direction = Quaternion.Euler(pitch, yaw, 0.0f);
transform.rotation = baseRotation * direction;
// vector pointing to center of this section
var N = direction * Vector3.forward;
// horizontal span of this section in degrees
var phi0 = yaw - (du / 2);
var phi1 = phi0 + du;
// vertical span of this section in degrees
var theta0 = pitch + (dv / 2);
var theta1 = theta0 - dv;
var midPhi = (phi0 + phi1) / 2;
var baseTheta = Mathf.Abs(theta0) < Mathf.Abs(theta1) ? theta0 : theta1;
// vectors pointing to corners of image closes to the equator
var V00 = Quaternion.Euler(baseTheta, phi0, 0.0f) * Vector3.forward;
var V01 = Quaternion.Euler(baseTheta, phi1, 0.0f) * Vector3.forward;
// vectors pointing to top and bottom midsection of image
var V0M = Quaternion.Euler(theta0, midPhi, 0.0f) * Vector3.forward;
var V1M = Quaternion.Euler(theta1, midPhi, 0.0f) * Vector3.forward;
// intersection points for each of the above
var P00 = V00 / Vector3.Dot(V00, N);
var P01 = V01 / Vector3.Dot(V01, N);
var P0M = V0M / Vector3.Dot(V0M, N);
var P1M = V1M / Vector3.Dot(V1M, N);
// calculate basis vectors for plane
var P00_P01 = P01 - P00;
var P0M_P1M = P1M - P0M;
var uMag = P00_P01.magnitude;
var vMag = P0M_P1M.magnitude;
var uScale = 1.0f / uMag;
var vScale = 1.0f / vMag;
var uAxis = P00_P01 * uScale;
var vAxis = P0M_P1M * vScale;
// update material constant buffer
fx.Set(N, phi0, phi1, theta0, theta1,
uAxis, P00, uScale,
vAxis, P0M, vScale);
camera.aspect = uMag / vMag;
camera.Render();
RenderTexture.active = targetTexture;
texture.ReadPixels(new Rect(0, 0, targetTexture.width, targetTexture.height), uTarget, vTarget);
RenderTexture.active = null;
}
}
}
}
// Save textures to disk.
for (int i = 0; i < 2; i++)
{
var texture = textures[i];
texture.Apply();
var assetName = string.Format(nameFormat, assetPath, target.name, i);
File.WriteAllBytes(assetName, texture.EncodeToPNG());
}
// Cleanup.
if (camera != tempCamera)
{
camera.targetTexture = oldTargetTexture;
camera.orthographic = oldOrthographic;
camera.fieldOfView = oldFieldOfView;
camera.aspect = oldAspect;
target.transform.localPosition = oldPosition;
target.transform.localRotation = oldRotation;
}
else
{
tempCamera.targetTexture = null;
}
DestroyImmediate(targetTexture);
DestroyImmediate(fx);
timer.Stop();
Debug.Log(string.Format("Screenshot took {0} seconds.", timer.Elapsed));
}
if (tempCamera != null)
{
DestroyImmediate(tempCamera.gameObject);
}
DestroyImmediate(textures[0]);
DestroyImmediate(textures[1]);
// Now that everything has be written out, reload the associated assets and assign them.
AssetDatabase.Refresh();
foreach (SteamVR_Skybox target in targets)
{
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
for (int i = 0; i < 2; i++)
{
var assetName = string.Format(nameFormat, assetPath, target.name, i);
var importer = AssetImporter.GetAtPath(assetName) as TextureImporter;
importer.mipmapEnabled = false;
importer.wrapMode = TextureWrapMode.Repeat;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
importer.SetPlatformTextureSettings("Standalone", width, TextureImporterFormat.RGB24);
#else
var settings = importer.GetPlatformTextureSettings("Standalone");
settings.textureCompression = TextureImporterCompression.Uncompressed;
settings.maxTextureSize = width;
importer.SetPlatformTextureSettings(settings);
#endif
importer.SaveAndReimport();
var texture = AssetDatabase.LoadAssetAtPath<Texture2D>(assetName);
target.SetTextureByIndex(i, texture);
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 80087fbbf7bf93a46bb4aea276b19568
timeCreated: 1446765449
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,166 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Notify developers when a new version of the plugin is available.
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text.RegularExpressions;
[InitializeOnLoad]
public class SteamVR_Update : EditorWindow
{
const string currentVersion = "1.2.0";
const string versionUrl = "http://media.steampowered.com/apps/steamvr/unitypluginversion.txt";
const string notesUrl = "http://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt";
const string pluginUrl = "http://u3d.as/content/valve-corporation/steam-vr-plugin";
const string doNotShowKey = "SteamVR.DoNotShow.v{0}";
static WWW wwwVersion, wwwNotes;
static string version, notes;
static SteamVR_Update window;
static SteamVR_Update()
{
wwwVersion = new WWW(versionUrl);
EditorApplication.update += Update;
}
static void Update()
{
if (wwwVersion != null)
{
if (!wwwVersion.isDone)
return;
if (UrlSuccess(wwwVersion))
version = wwwVersion.text;
wwwVersion = null;
if (ShouldDisplay())
{
var url = string.Format(notesUrl, version);
wwwNotes = new WWW(url);
window = GetWindow<SteamVR_Update>(true);
window.minSize = new Vector2(320, 440);
//window.title = "SteamVR";
}
}
if (wwwNotes != null)
{
if (!wwwNotes.isDone)
return;
if (UrlSuccess(wwwNotes))
notes = wwwNotes.text;
wwwNotes = null;
if (notes != "")
window.Repaint();
}
EditorApplication.update -= Update;
}
static bool UrlSuccess(WWW www)
{
if (!string.IsNullOrEmpty(www.error))
return false;
if (Regex.IsMatch(www.text, "404 not found", RegexOptions.IgnoreCase))
return false;
return true;
}
static bool ShouldDisplay()
{
if (string.IsNullOrEmpty(version))
return false;
if (version == currentVersion)
return false;
if (EditorPrefs.HasKey(string.Format(doNotShowKey, version)))
return false;
// parse to see if newer (e.g. 1.0.4 vs 1.0.3)
var versionSplit = version.Split('.');
var currentVersionSplit = currentVersion.Split('.');
for (int i = 0; i < versionSplit.Length && i < currentVersionSplit.Length; i++)
{
int versionValue, currentVersionValue;
if (int.TryParse(versionSplit[i], out versionValue) &&
int.TryParse(currentVersionSplit[i], out currentVersionValue))
{
if (versionValue > currentVersionValue)
return true;
if (versionValue < currentVersionValue)
return false;
}
}
// same up to this point, now differentiate based on number of sub values (e.g. 1.0.4.1 vs 1.0.4)
if (versionSplit.Length <= currentVersionSplit.Length)
return false;
return true;
}
Vector2 scrollPosition;
bool toggleState;
string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}
public void OnGUI()
{
EditorGUILayout.HelpBox("A new version of the SteamVR plugin is available!", MessageType.Warning);
var resourcePath = GetResourcePath();
var logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
var rect = GUILayoutUtility.GetRect(position.width, 150, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
GUILayout.Label("Current version: " + currentVersion);
GUILayout.Label("New version: " + version);
if (notes != "")
{
GUILayout.Label("Release notes:");
EditorGUILayout.HelpBox(notes, MessageType.Info);
}
GUILayout.EndScrollView();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Get Latest Version"))
{
Application.OpenURL(pluginUrl);
}
EditorGUI.BeginChangeCheck();
var doNotShow = GUILayout.Toggle(toggleState, "Do not prompt for this version again.");
if (EditorGUI.EndChangeCheck())
{
toggleState = doNotShow;
var key = string.Format(doNotShowKey, version);
if (doNotShow)
EditorPrefs.SetBool(key, true);
else
EditorPrefs.DeleteKey(key);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 73a0556bda803bf4e898751dcfcf21a8
timeCreated: 1433880062
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 61f4796ee4f00314e8d8b1ad39a78c28
folderAsset: yes
timeCreated: 1438797390
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,88 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using System.Collections;
public struct GazeEventArgs
{
public float distance;
}
public delegate void GazeEventHandler(object sender, GazeEventArgs e);
public class SteamVR_GazeTracker : MonoBehaviour
{
public bool isInGaze = false;
public event GazeEventHandler GazeOn;
public event GazeEventHandler GazeOff;
public float gazeInCutoff = 0.15f;
public float gazeOutCutoff = 0.4f;
// Contains a HMD tracked object that we can use to find the user's gaze
Transform hmdTrackedObject = null;
// Use this for initialization
void Start ()
{
}
public virtual void OnGazeOn(GazeEventArgs e)
{
if (GazeOn != null)
GazeOn(this, e);
}
public virtual void OnGazeOff(GazeEventArgs e)
{
if (GazeOff != null)
GazeOff(this, e);
}
// Update is called once per frame
void Update ()
{
// If we haven't set up hmdTrackedObject find what the user is looking at
if (hmdTrackedObject == null)
{
SteamVR_TrackedObject[] trackedObjects = FindObjectsOfType<SteamVR_TrackedObject>();
foreach (SteamVR_TrackedObject tracked in trackedObjects)
{
if (tracked.index == SteamVR_TrackedObject.EIndex.Hmd)
{
hmdTrackedObject = tracked.transform;
break;
}
}
}
if (hmdTrackedObject)
{
Ray r = new Ray(hmdTrackedObject.position, hmdTrackedObject.forward);
Plane p = new Plane(hmdTrackedObject.forward, transform.position);
float enter = 0.0f;
if (p.Raycast(r, out enter))
{
Vector3 intersect = hmdTrackedObject.position + hmdTrackedObject.forward * enter;
float dist = Vector3.Distance(intersect, transform.position);
//Debug.Log("Gaze dist = " + dist);
if (dist < gazeInCutoff && !isInGaze)
{
isInGaze = true;
GazeEventArgs e;
e.distance = dist;
OnGazeOn(e);
}
else if (dist >= gazeOutCutoff && isInGaze)
{
isInGaze = false;
GazeEventArgs e;
e.distance = dist;
OnGazeOff(e);
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 501eb8b744f73714fbe7dbdd5e3ef66e
timeCreated: 1426193800
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,141 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using System.Collections;
public struct PointerEventArgs
{
public uint controllerIndex;
public uint flags;
public float distance;
public Transform target;
}
public delegate void PointerEventHandler(object sender, PointerEventArgs e);
public class SteamVR_LaserPointer : MonoBehaviour
{
public bool active = true;
public Color color;
public float thickness = 0.002f;
public GameObject holder;
public GameObject pointer;
bool isActive = false;
public bool addRigidBody = false;
public Transform reference;
public event PointerEventHandler PointerIn;
public event PointerEventHandler PointerOut;
Transform previousContact = null;
// Use this for initialization
void Start ()
{
holder = new GameObject();
holder.transform.parent = this.transform;
holder.transform.localPosition = Vector3.zero;
holder.transform.localRotation = Quaternion.identity;
pointer = GameObject.CreatePrimitive(PrimitiveType.Cube);
pointer.transform.parent = holder.transform;
pointer.transform.localScale = new Vector3(thickness, thickness, 100f);
pointer.transform.localPosition = new Vector3(0f, 0f, 50f);
pointer.transform.localRotation = Quaternion.identity;
BoxCollider collider = pointer.GetComponent<BoxCollider>();
if (addRigidBody)
{
if (collider)
{
collider.isTrigger = true;
}
Rigidbody rigidBody = pointer.AddComponent<Rigidbody>();
rigidBody.isKinematic = true;
}
else
{
if(collider)
{
Object.Destroy(collider);
}
}
Material newMaterial = new Material(Shader.Find("Unlit/Color"));
newMaterial.SetColor("_Color", color);
pointer.GetComponent<MeshRenderer>().material = newMaterial;
}
public virtual void OnPointerIn(PointerEventArgs e)
{
if (PointerIn != null)
PointerIn(this, e);
}
public virtual void OnPointerOut(PointerEventArgs e)
{
if (PointerOut != null)
PointerOut(this, e);
}
// Update is called once per frame
void Update ()
{
if (!isActive)
{
isActive = true;
this.transform.GetChild(0).gameObject.SetActive(true);
}
float dist = 100f;
SteamVR_TrackedController controller = GetComponent<SteamVR_TrackedController>();
Ray raycast = new Ray(transform.position, transform.forward);
RaycastHit hit;
bool bHit = Physics.Raycast(raycast, out hit);
if(previousContact && previousContact != hit.transform)
{
PointerEventArgs args = new PointerEventArgs();
if (controller != null)
{
args.controllerIndex = controller.controllerIndex;
}
args.distance = 0f;
args.flags = 0;
args.target = previousContact;
OnPointerOut(args);
previousContact = null;
}
if(bHit && previousContact != hit.transform)
{
PointerEventArgs argsIn = new PointerEventArgs();
if (controller != null)
{
argsIn.controllerIndex = controller.controllerIndex;
}
argsIn.distance = hit.distance;
argsIn.flags = 0;
argsIn.target = hit.transform;
OnPointerIn(argsIn);
previousContact = hit.transform;
}
if(!bHit)
{
previousContact = null;
}
if (bHit && hit.distance < 100f)
{
dist = hit.distance;
}
if (controller != null && controller.triggerPressed)
{
pointer.transform.localScale = new Vector3(thickness * 5f, thickness * 5f, dist);
}
else
{
pointer.transform.localScale = new Vector3(thickness, thickness, dist);
}
pointer.transform.localPosition = new Vector3(0f, 0f, dist/2f);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d4e8a839a7c5b7e4580c59e305fb5f01
timeCreated: 1430337756
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,98 @@
using UnityEngine;
using System.Collections;
public class SteamVR_Teleporter : MonoBehaviour
{
public enum TeleportType
{
TeleportTypeUseTerrain,
TeleportTypeUseCollider,
TeleportTypeUseZeroY
}
public bool teleportOnClick = false;
public TeleportType teleportType = TeleportType.TeleportTypeUseZeroY;
Transform reference
{
get
{
var top = SteamVR_Render.Top();
return (top != null) ? top.origin : null;
}
}
void Start()
{
var trackedController = GetComponent<SteamVR_TrackedController>();
if (trackedController == null)
{
trackedController = gameObject.AddComponent<SteamVR_TrackedController>();
}
trackedController.TriggerClicked += new ClickedEventHandler(DoClick);
if (teleportType == TeleportType.TeleportTypeUseTerrain)
{
// Start the player at the level of the terrain
var t = reference;
if (t != null)
t.position = new Vector3(t.position.x, Terrain.activeTerrain.SampleHeight(t.position), t.position.z);
}
}
void DoClick(object sender, ClickedEventArgs e)
{
if (teleportOnClick)
{
// First get the current Transform of the the reference space (i.e. the Play Area, e.g. CameraRig prefab)
var t = reference;
if (t == null)
return;
// Get the current Y position of the reference space
float refY = t.position.y;
// Create a plane at the Y position of the Play Area
// Then create a Ray from the origin of the controller in the direction that the controller is pointing
Plane plane = new Plane(Vector3.up, -refY);
Ray ray = new Ray(this.transform.position, transform.forward);
// Set defaults
bool hasGroundTarget = false;
float dist = 0f;
if (teleportType == TeleportType.TeleportTypeUseTerrain) // If we picked to use the terrain
{
RaycastHit hitInfo;
TerrainCollider tc = Terrain.activeTerrain.GetComponent<TerrainCollider>();
hasGroundTarget = tc.Raycast(ray, out hitInfo, 1000f);
dist = hitInfo.distance;
}
else if (teleportType == TeleportType.TeleportTypeUseCollider) // If we picked to use the collider
{
RaycastHit hitInfo;
hasGroundTarget = Physics.Raycast(ray, out hitInfo);
dist = hitInfo.distance;
}
else // If we're just staying flat on the current Y axis
{
// Intersect a ray with the plane that was created earlier
// and output the distance along the ray that it intersects
hasGroundTarget = plane.Raycast(ray, out dist);
}
if (hasGroundTarget)
{
// Get the current Camera (head) position on the ground relative to the world
Vector3 headPosOnGround = new Vector3(SteamVR_Render.Top().head.position.x, refY, SteamVR_Render.Top().head.position.z);
// We need to translate the reference space along the same vector
// that is between the head's position on the ground and the intersection point on the ground
// i.e. intersectionPoint - headPosOnGround = translateVector
// currentReferencePosition + translateVector = finalPosition
t.position = t.position + (ray.origin + (ray.direction * dist)) - headPosOnGround;
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 24c7d7d77dd0d2a4b8e1ad129b170ee3
timeCreated: 1430337756
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4b6669fb4e4df9c48926f02b694be9d1
timeCreated: 1437433018
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,58 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(SteamVR_TrackedObject))]
public class SteamVR_TestThrow : MonoBehaviour
{
public GameObject prefab;
public Rigidbody attachPoint;
SteamVR_TrackedObject trackedObj;
FixedJoint joint;
void Awake()
{
trackedObj = GetComponent<SteamVR_TrackedObject>();
}
void FixedUpdate()
{
var device = SteamVR_Controller.Input((int)trackedObj.index);
if (joint == null && device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger))
{
var go = GameObject.Instantiate(prefab);
go.transform.position = attachPoint.transform.position;
joint = go.AddComponent<FixedJoint>();
joint.connectedBody = attachPoint;
}
else if (joint != null && device.GetTouchUp(SteamVR_Controller.ButtonMask.Trigger))
{
var go = joint.gameObject;
var rigidbody = go.GetComponent<Rigidbody>();
Object.DestroyImmediate(joint);
joint = null;
Object.Destroy(go, 15.0f);
// We should probably apply the offset between trackedObj.transform.position
// and device.transform.pos to insert into the physics sim at the correct
// location, however, we would then want to predict ahead the visual representation
// by the same amount we are predicting our render poses.
var origin = trackedObj.origin ? trackedObj.origin : trackedObj.transform.parent;
if (origin != null)
{
rigidbody.velocity = origin.TransformVector(device.velocity);
rigidbody.angularVelocity = origin.TransformVector(device.angularVelocity);
}
else
{
rigidbody.velocity = device.velocity;
rigidbody.angularVelocity = device.angularVelocity;
}
rigidbody.maxAngularVelocity = rigidbody.angularVelocity.magnitude;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ff4f36585e15b1942827390ff1a92502
timeCreated: 1437513988
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0d936163b5e9a5047b5e4ba5afaf5126
timeCreated: 1437513966
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,84 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
public class SteamVR_TestTrackedCamera : MonoBehaviour
{
public Material material;
public Transform target;
public bool undistorted = true;
public bool cropped = true;
void OnEnable()
{
// The video stream must be symmetrically acquired and released in
// order to properly disable the stream once there are no consumers.
var source = SteamVR_TrackedCamera.Source(undistorted);
source.Acquire();
// Auto-disable if no camera is present.
if (!source.hasCamera)
enabled = false;
}
void OnDisable()
{
// Clear the texture when no longer active.
material.mainTexture = null;
// The video stream must be symmetrically acquired and released in
// order to properly disable the stream once there are no consumers.
var source = SteamVR_TrackedCamera.Source(undistorted);
source.Release();
}
void Update()
{
var source = SteamVR_TrackedCamera.Source(undistorted);
var texture = source.texture;
if (texture == null)
{
return;
}
// Apply the latest texture to the material. This must be performed
// every frame since the underlying texture is actually part of a ring
// buffer which is updated in lock-step with its associated pose.
// (You actually really only need to call any of the accessors which
// internally call Update on the SteamVR_TrackedCamera.VideoStreamTexture).
material.mainTexture = texture;
// Adjust the height of the quad based on the aspect to keep the texels square.
var aspect = (float)texture.width / texture.height;
// The undistorted video feed has 'bad' areas near the edges where the original
// square texture feed is stretched to undo the fisheye from the lens.
// Therefore, you'll want to crop it to the specified frameBounds to remove this.
if (cropped)
{
var bounds = source.frameBounds;
material.mainTextureOffset = new Vector2(bounds.uMin, bounds.vMin);
var du = bounds.uMax - bounds.uMin;
var dv = bounds.vMax - bounds.vMin;
material.mainTextureScale = new Vector2(du, dv);
aspect *= Mathf.Abs(du / dv);
}
else
{
material.mainTextureOffset = Vector2.zero;
material.mainTextureScale = new Vector2(1, -1);
}
target.localScale = new Vector3(1, 1.0f / aspect, 1);
// Apply the pose that this frame was recorded at.
if (source.hasTracking)
{
var t = source.transform;
target.localPosition = t.pos;
target.localRotation = t.rot;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8b18b36a995ecb04599f35c2741be8d5
timeCreated: 1465946679
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SteamVR_TestTrackedCamera
m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 0.5, y: -0.49999994}
m_Offset: {x: 0.25, y: 0.75}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 99ee8d48ccf36264e9d9a72baa681249
timeCreated: 1465950289
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,749 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
SceneSettings:
m_ObjectHideFlags: 0
m_PVSData:
m_PVSObjectsArray: []
m_PVSPortalsArray: []
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 6
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 6
m_GIWorkflowMode: 0
m_LightmapsMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 3
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AOMaxDistance: 1
m_Padding: 2
m_CompAOExponent: 0
m_LightmapParameters: {fileID: 0}
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
cellSize: 0.16666667
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &1110379724
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.x
value: -2.49
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.z
value: -1.95
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.w
value: 0.7071067
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2395298, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11453314, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2337482, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11438774, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 477890, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 477890, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3380982, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 1186597620}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: drawInGame
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[0].x
value: 1.64999974
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[0].z
value: -.80000025
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[1].x
value: -1.64999974
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[1].z
value: -.80000025
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[2].x
value: -1.64999974
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[2].z
value: .80000025
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[3].x
value: 1.64999974
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[3].z
value: .80000025
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[4].x
value: 1.79999971
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[4].z
value: -.950000286
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[5].x
value: -1.79999971
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[5].z
value: -.950000286
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[6].x
value: -1.79999971
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[6].z
value: .950000286
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[7].x
value: 1.79999971
objectReference: {fileID: 0}
- target: {fileID: 11489174, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: vertices.Array.data[7].z
value: .950000286
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2082592, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: far clip plane
value: 100
objectReference: {fileID: 0}
- target: {fileID: 2082592, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: near clip plane
value: .0199999996
objectReference: {fileID: 0}
- target: {fileID: 11453314, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: modelOverride
value:
objectReference: {fileID: 0}
- target: {fileID: 3370552, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2395298, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2041284010}
- target: {fileID: 426554, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 402434, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 440048, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 147176, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 192944, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11417306, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: modelOverride
value:
objectReference: {fileID: 0}
- target: {fileID: 482514, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 482514, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.y
value: 0.264
objectReference: {fileID: 0}
- target: {fileID: 11417168, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: modelOverride
value:
objectReference: {fileID: 0}
- target: {fileID: 478542, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2348914, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 1862156363}
m_RemovedComponents:
- {fileID: 11403694, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
- {fileID: 11438774, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
- {fileID: 11453314, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
- {fileID: 11420968, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_IsPrefabParent: 0
--- !u!43 &1186597620
Mesh:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
serializedVersion: 8
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.7000004, y: 0, z: 1.3000007}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexBuffer: 000004000100010004000500010005000200020005000600020006000300030006000700030007000000000007000400
m_Skin: []
m_VertexData:
m_CurrentChannels: 13
m_VertexCount: 8
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 12
format: 0
dimension: 4
- stream: 0
offset: 28
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 288
_typelessdata: 6a66c63f0ad7233c393393bf000000000000803f0000803f0000803f00000000000000006a66c6bf0ad7233c393393bf000000000000803f0000803f0000803f0000803f000000006a66c6bf0ad7233c3933933f000000000000803f0000803f0000803f00000000000000006a66c63f0ad7233c3933933f000000000000803f0000803f0000803f0000803f000000009d99d93f0ad7233c6c66a6bf000000000000803f0000803f00000000000000000000803f9d99d9bf0ad7233c6c66a6bf000000000000803f0000803f000000000000803f0000803f9d99d9bf0ad7233c6c66a63f000000000000803f0000803f00000000000000000000803f9d99d93f0ad7233c6c66a63f000000000000803f0000803f000000000000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.7000004, y: 0, z: 1.3000007}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshOptimized: 0
--- !u!1 &1569421957
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1569421959}
- 108: {fileID: 1569421958}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1569421958
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1569421957}
m_Enabled: 1
serializedVersion: 6
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_BounceIntensity: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
m_AreaSize: {x: 1, y: 1}
--- !u!4 &1569421959
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1569421957}
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!4 &1779605316 stripped
Transform:
m_PrefabParentObject: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_PrefabInternal: {fileID: 1110379724}
--- !u!1 &1824250565
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1824250566}
- 33: {fileID: 1824250569}
- 64: {fileID: 1824250568}
- 23: {fileID: 1824250567}
m_Layer: 0
m_Name: Quad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1824250566
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1824250565}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 1951799181}
m_RootOrder: 0
--- !u!23 &1824250567
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1824250565}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 99ee8d48ccf36264e9d9a72baa681249, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &1824250568
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1824250565}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &1824250569
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1824250565}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!21 &1862156363
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Sprites/Default
m_Shader: {fileID: 10753, guid: 0000000000000000e000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: PixelSnap
second: 0
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!1 &1951799180
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1951799181}
- 114: {fileID: 1951799182}
m_Layer: 0
m_Name: TrackedCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1951799181
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1951799180}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 2}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1824250566}
m_Father: {fileID: 1779605316}
m_RootOrder: 3
--- !u!114 &1951799182
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1951799180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b18b36a995ecb04599f35c2741be8d5, type: 3}
m_Name:
m_EditorClassIdentifier:
material: {fileID: 2100000, guid: 99ee8d48ccf36264e9d9a72baa681249, type: 2}
target: {fileID: 1951799181}
undistorted: 1
cropped: 1
--- !u!1 &2032672589
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 2032672593}
- 33: {fileID: 2032672592}
- 64: {fileID: 2032672591}
- 23: {fileID: 2032672590}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!23 &2032672590
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2032672589}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &2032672591
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2032672589}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &2032672592
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2032672589}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2032672593
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2032672589}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!21 &2041284010
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Standard
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs: {}
m_Floats: {}
m_Colors: {}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7fb811b0ffe615b4dbf1d5e6ced385fd
timeCreated: 1464227836
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More