Exemple #1
0
 void Update()
 {
     if (Input.GetKeyUp("up"))
     {
         rob_mov.MoveForward();
     }
     if (Input.GetKeyUp("left"))
     {
         rob_mov.RotateRobot(false);
     }
     if (Input.GetKeyUp("right"))
     {
         rob_mov.RotateRobot(true);
     }
     if (Input.GetKeyUp("e"))
     {
         rob_mov.FireRocket();
     }
 }
Exemple #2
0
 void Update()
 {
     if (transform.childCount > 0)
     {
         if (!activated)
         {
             if (transform.GetChild(0).gameObject.tag == "Robot")
             {
                 GameObject    robot     = transform.GetChild(0).gameObject;
                 RobotMovement robot_scr = robot.GetComponent <RobotMovement>();
                 AudioManager.instance.Play("tile_turn");
                 if (robot_scr.RotateRobot(Random.value > 0.5f))
                 {
                     activated = true;
                 }
             }
         }
     }
     else
     {
         activated = false;
     }
 }