void Start()
    {
        mainCamera = Camera.main;
        gameManager = mainCamera.gameObject.GetComponent<RealManager>();

        //Debug.Log (Screen.width.ToString() + ", " + Screen.height.ToString());
    }
Exemple #2
0
        // Command
        public IActionResult Command()
        {
            if (!Validate())
            {
                return(RedirectLogin());
            }
            ViewData["Current"] = "2";
            if (rm == null || rm.Status == false)
            {
                rm = new RealManager();
                try
                {
                    if (Directory.Exists(@"C:\"))
                    {
                        rm.RealAction("cmd", "");
                    }
                    //rm.RealAction("systeminfo", "");
                    else
                    {
                        string[] mcRoot  = new string[2];
                        string[] tmpRoot = System.IO.File.ReadAllText("MC.conf").Split("|");
                        if (tmpRoot.Length != 2)
                        {
                            throw new Exception("运行时出错。");
                        }
                        else
                        {
                            mcRoot[0] = tmpRoot[0];
                            mcRoot[1] = tmpRoot[1];
                        }

                        try
                        {
                            rm.RealAction(mcRoot[0], mcRoot[1]);
                        }
                        catch (Exception)
                        {
                        }
                        //rm.RealAction("bash", "");
                        //rm.SendMessage("cat /proc/version;lsb_release -a;exit");
                    }
                }
                catch (Exception ex)
                {
                    return(Json(new
                    {
                        code = "-101",
                        message = ex.ToString()
                    }));
                }
                rm.Status = true;
            }
            return(View());
        }
 void Awake()
 {
     _mainManager = Camera.main.gameObject.GetComponent<RealManager>();
 }