Skip to content

Commit

Permalink
#25
Browse files Browse the repository at this point in the history
add sushi images
fearture showing sushi in mainmenu
  • Loading branch information
harihitode committed Jan 7, 2016
1 parent 7bf5a3a commit 1af06dd
Show file tree
Hide file tree
Showing 11 changed files with 416 additions and 26 deletions.
54 changes: 51 additions & 3 deletions Assets/MainMenu.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,69 @@
using UnityEngine;
using System;
using System.Globalization;
using System.Collections;
using Leap;
using Recognizer;

public class MainMenu : MonoBehaviour {
public UnityEngine.UI.Image pictureR;
public UnityEngine.UI.Image pictureL;

Controller controller = new Controller();
struct message {
public int gazou;
public bool you;
};

Leap.Controller controller = new Leap.Controller();
private ThumbsUpRecognizer tsr;

private System.Collections.Generic.Stack <message> messages;
private bool linemode = false;

string selectGazou (int tmp) {
switch (tmp) {
case 0:
return "salmon";
case 1:
return "toro";
case 2:
return "tamago";
default:
return "kappa";
}
}

// Use this for initialization
void Start () {
tsr = new ThumbsUpRecognizer(() => { Application.LoadLevel ("CameraScene"); });
messages = new System.Collections.Generic.Stack<message>(){};

}

void showImages () {
if(messages.Count > 0){
message last = messages.Peek();
int gazou = last.gazou;
pictureL.sprite = Resources.Load <Sprite>(selectGazou(gazou));
pictureR.sprite = Resources.Load <Sprite>(selectGazou(gazou));
linemode = !linemode;
pictureL.enabled = linemode;
pictureR.enabled = linemode;
}
}

// Update is called once per frame
void Update () {
Frame frame = controller.Frame ();
Leap.Frame frame = controller.Frame ();
tsr.InvokeIfRecognized (frame);

if (Input.GetKey(KeyCode.Space)) {
showImages();

} else if (Input.GetKey(KeyCode.A)){
message t = new message();
t.gazou = UnityEngine.Random.Range (0, 4);
t.you = true;
messages.Push(t);
}
}
}
Binary file added Assets/Resources/kappa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions Assets/Resources/kappa.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/salmon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions Assets/Resources/salmon.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/tamago.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions Assets/Resources/tamago.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/toro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions Assets/Resources/toro.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/Scripts/TcpTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,4 @@ private IEnumerator DisplayScreenShot ()
}
}
}

Loading

0 comments on commit 1af06dd

Please sign in to comment.