Exemplo n.º 1
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(0, 0, 100, 50), onRunning?"Stop":"Start"))
     {
         if (onRunning)
         {
             onRunning = false;
             action.Stop();
         }
         else
         {
             onRunning = true;
             action.Continue();
         }
     }
     if (GUI.Button(new Rect(0, 50, 100, 50), "Restart"))
     {
         onRunning = true;
         action.Restart();
     }
 }