Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         tryAddNode();
     }
     if (Input.GetMouseButtonDown(1))
     {
         tryRemoveNode();
     }
     //spawn train at highlighted node.
     if (Input.GetKeyDown(KeyCode.T))
     {
         GameObject obj = GridUtil.getGameObjectAtCursor(m_camera);
         if (obj != null && obj.layer == LayerMask.NameToLayer("Nodes"))
         {
             m_lineEditor.addTrainForCurrentLineAtNode(obj, false);
         }
     }
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Application.Quit();
     }
     if (Input.GetKeyDown(KeyCode.P))
     {
         PausableMonoBehavior.m_paused = !PausableMonoBehavior.m_paused;
     }
     if (Input.GetKeyDown(KeyCode.N))
     {
         m_lineEditor.startNewLine();
     }
 }