예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.B))
        {
            StartCoroutine(projectHandle.ListNodes(
                               (List <GNS3ProjectHandle.Node> nodes) =>
            {
                foreach (var node in nodes)
                {
                    Debug.Log(node.name + " " + node.console_type);
                    foreach (var port in node.ports)
                    {
                        Debug.Log(port.adapter_number + " " + port.port_number);
                    }
                }
            },
                               () => Debug.Log("ListNodes failed")
                               ));
        }
        if (Input.GetKeyDown(KeyCode.X))
        {
            var appliances = handle.GetAppliances();
            foreach (var appliance in appliances)
            {
                Debug.Log(appliance.name + " " + appliance.appliance_id + " " + appliance.category);
            }
        }

        if (OVRInput.GetDown(OVRInput.Button.Two)) // 'B' button

        {
            if (!main_menu_active)
            {
                wakeMenu();
            }
            else
            {
                sleepMenu();
            }
        }

        operateMenu();
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Z))
     {
         StartCoroutine(handle.ListProjects(
                            (GNS3Handle.Projects projects) => {
             foreach (var project in projects.projects)
             {
                 Debug.Log(project.name + " " + project.project_id);
             }
         },
                            () => Debug.Log("Failed")
                            ));
     }
     if (Input.GetKeyDown(KeyCode.X))
     {
         var appliances = handle.GetAppliances();
         foreach (var appliance in appliances)
         {
             Debug.Log(appliance.name + " " + appliance.appliance_id + " " + appliance.category);
         }
     }
     if (Input.GetKeyDown(KeyCode.C))
     {
         var nodes = projectHandle.GetNodes();
         projectHandle.SendToConsole(nodes[0], "\rconf t\rint fa0/0\rip address 192.168.1.1 255.255.255.0\rno shutdown\rend\r");
         projectHandle.StreamFromConsole(nodes[0], (s) => Debug.Log(s));
     }
     if (Input.GetKeyDown(KeyCode.V))
     {
         // StartCoroutine(projectHandle.CreateAppliance("7465a102-5c54-4cc6-ab76-7e917955223b"));
     }
     if (Input.GetKeyDown(KeyCode.B))
     {
         StartCoroutine(projectHandle.ListNodes(
                            (List <GNS3ProjectHandle.Node> nodes) =>
         {
             foreach (var node in nodes)
             {
                 Debug.Log(node.name + " " + node.console_type);
                 foreach (var port in node.ports)
                 {
                     Debug.Log(port.adapter_number + " " + port.port_number);
                 }
             }
         },
                            () => Debug.Log("ListNodes failed")
                            ));
     }
     if (Input.GetKeyDown(KeyCode.N))
     {
         // StartCoroutine(projectHandle.CreateLink("0453abfb-900b-44cb-811c-ea77e79fda6c", "5b2ca014-913b-4a72-b6bc-23588cd34c48", 0, 0));
     }
     if (Input.GetKeyDown(KeyCode.U))
     {
         var nodes = projectHandle.GetNodes();
         StartCoroutine(projectHandle.StartNode(nodes[0].node_id));
     }
     if (Input.GetKeyDown(KeyCode.I))
     {
         var nodes = projectHandle.GetNodes();
         StartCoroutine(projectHandle.StopNode(nodes[0].node_id));
     }
 }