var tex: Texture;
var tex2: Texture;
public var emo: int;
var emo1: int;
var last: boolean;
var first: boolean;
var Guivar : Guivar;
var go : GameObject;
var go2 : GameObject;
var played: boolean = false;
//var movecamera : camera;
var Gui_old: Gui;
var Gui: Gui;
var Camerascript: camera;
function OnGUI() {
if (first){
if (GUI.Button(Rect(Screen.width/2-100,Screen.height/2+140,70,40),"Start"))
StartCoroutine(MyCoroutine());
if (GUI.Button(Rect(Screen.width/2+30,Screen.height/2+140,70,40),"Retry") && played)
{
StartCoroutine(MyCoroutine());
Guivar.scorekoef=Guivar.scorekoef-0.1;
};
}
if (!first)
if (GUI.Button(Rect(Screen.width/2-35,Screen.height/2+140,70,40),"Retry")&&played)
{
StartCoroutine(MyCoroutine());
Guivar.scorekoef=Guivar.scorekoef-0.1;
};
if (GUI.Button(Rect(Screen.width/2-200,Screen.height/2-100,70,40),"1")&&played)
{
if (emo1==1)
{
Guivar.score=Guivar.score+1;
}
RunAway();
}
if (GUI.Button(Rect(Screen.width/2-200,Screen.height/2-20,70,40),"2")&&played)
{
if (emo1==2)
{
Guivar.score=Guivar.score+1;
}
RunAway();
}
if (GUI.Button(Rect(Screen.width/2-200,Screen.height/2+60,70,40),"3")&&played)
{
if (emo1==3)
{
Guivar.score=Guivar.score+1;
}
RunAway();
}
if (GUI.Button(Rect(Screen.width/2+135,Screen.height/2-100,70,40),"4")&&played)
{
if (emo1==4)
{
Guivar.score=Guivar.score+1;
}
RunAway();
}
if (GUI.Button(Rect(Screen.width/2+135,Screen.height/2-20,70,40),"5")&&played)
{
if (emo1==5)
{
Guivar.score=Guivar.score+1;
}
RunAway();
}
if (GUI.Button(Rect(Screen.width/2+135,Screen.height/2+60,70,40),"6")&&played)
{
if (emo1==6)
{
Guivar.score=Guivar.score+1;
}
RunAway();
}
}
function MyCoroutine()
{
yield WaitForSeconds(1);
guiTexture.texture = tex2;
yield WaitForSeconds(0.15);
emo1=emo;
guiTexture.texture = tex;
played=true;
}
function PlayStart() {
animation.Play("move2");
}
function RunAway() {
Debug.Log(Guivar.score);
animation.Play("move1");
Gui_old.enabled = false;
if (last){
// Debug.Log("Calculating");
go.guiText.text = ("Effectiveness of your lie definition is:");
go2.guiText.text = (Guivar.score*100/3*Guivar.scorekoef+" %");
Camerascript.enabled = true;
}
else
{
Gui.enabled = true;
Gui.PlayStart();
yield WaitForSeconds(3);
Gui.MyCoroutine();
};
}