-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sushi images fearture showing sushi in mainmenu
- Loading branch information
harihitode
committed
Jan 7, 2016
1 parent
7bf5a3a
commit 1af06dd
Showing
11 changed files
with
416 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,3 +145,4 @@ private IEnumerator DisplayScreenShot () | |
} | ||
} | ||
} | ||
|
Oops, something went wrong.