/*void OnApplicationQuit()
* {
* closeSocket();
* }*/
void Update()
{
//remember the On Computer Debug in inspector (GameController)
if (gameController.isRecordMode)
{
if (setWalk)
{
animator.SetBool("Idling", false);
Debug.Log("walking call play()\n");
mediaPlayerCtrl.Play();
}
else
{
animator.SetBool("Idling", true);
Debug.Log("call pause()\n");
mediaPlayerCtrl.Pause();
}
if (isPlayerAttack)
{
Debug.Log("set trigger\n");
animator.SetTrigger("Use");
}
}
//we can also replace this section with just mediaPlyerctrl.setDirection(1) or any value.....
if (GvrController.IsTouching)
{
Vector2 current_touchpos = GvrController.TouchPos;
//Debug.Log("EasyMovieTextureCsharp, current_touchpos = "+ current_touchpos.x +" , " + current_touchpos.y);
if ((current_touchpos.y < current_touchpos.x) && (current_touchpos.y < 1 - current_touchpos.x))
{
//Debug.Log("EasyMovieTextureCsharp, current_touchpos = forward");
mediaPlayerCtrl.setDirection(1);
}
else if ((current_touchpos.y < current_touchpos.x) && (current_touchpos.y > 1 - current_touchpos.x))
{
//Debug.Log("EasyMovieTextureCsharp, current_touchpos = right");
mediaPlayerCtrl.setDirection(161);
}
else if ((current_touchpos.y > current_touchpos.x) && (current_touchpos.y > 1 - current_touchpos.x))
{
//Debug.Log("EasyMovieTextureCsharp, current_touchpos = backward");
mediaPlayerCtrl.setDirection(-1);
}
else if ((current_touchpos.y > current_touchpos.x) && (current_touchpos.y < 1 - current_touchpos.x))
{
//Debug.Log("EasyMovieTextureCsharp, current_touchpos = left");
mediaPlayerCtrl.setDirection(-161);
}
print(Time.time);
if (counter == 0)
{
StartCoroutine(Example());
}
print(Time.time);
}
}