Exemplo n.º 1
0
 public void TaskOnClick()
 {
     if (isEnabled)
     {
         Debug.Log("Button pressed: " + direction.ToString());
         nav.VoteForDirection(direction);
     }
 }
Exemplo n.º 2
0
 void OnMouseDown()
 {
     // this button was clicked
     if (isEnabled)
     {
         string str = gameObject.name.Substring(6);
         if (str.Equals("Up"))
         {
             nav.VoteForDirection(NavGameController.Direction.Up);
         }
         else if (str.Equals("Down"))
         {
             nav.VoteForDirection(NavGameController.Direction.Down);
         }
         else if (str.Equals("Left"))
         {
             nav.VoteForDirection(NavGameController.Direction.Left);
         }
         else if (str.Equals("Right"))
         {
             nav.VoteForDirection(NavGameController.Direction.Right);
         }
     }
 }