Example #1
0
 private void Awake()
 {
     windowswitch = new WindowSwitchUnity();
     if (windowswitch.OnOpenedByParent(ref parmars))
     {
         //以外部程序的方式打开
         parentT.text = parentHandle.ToString();
     }
     openChild.onClick.AddListener(TryOpenChild);
     closeChild.onClick.AddListener(TryCloseChild);
 }
    private void Awake()
    {
        InitMessage();

        windowswitch = new WindowSwitchUnity();
        if (windowswitch.OnOpenedByParent(ref parmars))
        {
            //以外部程序的方式打开
            parentT.text = parentHandle.ToString();
            parentSender.RegistHandle(parentHandle);
        }
        openChild.onClick.AddListener(TryOpenChild);
        closeChild.onClick.AddListener(TryCloseChild);
        parentI.onEndEdit.AddListener(SendInfoToParent);
        childI.onEndEdit.AddListener(SendInfoToChild);
    }
    public void TryOpenHelpExe(string exePath)
    {
        windowswitch = new WindowSwitchUnity();
        string path = exePath;// Application.dataPath.Substring(0, Application.dataPath.LastIndexOf("Demo")) + "FormLoader/FormLoader/bin/Debug/FormLoader.exe";

        if (System.IO.File.Exists(path))
        {
#if UNITY_EDITOR
            if (windowswitch.OpenChildWindow(path, false, "1"))
#else
            if (windowswitch.OpenChildWindow(path, false))
#endif
            {
                //打开子应用程序
                StartCoroutine(DelyRegisterSender());
            }
        }
        else
        {
            Debug.LogError("exe not fond");
        }
        sendThread.Start();
    }