Beispiel #1
0
    static void ShowResult()
    {
        CheckConfig window = (CheckConfig)EditorWindow.GetWindow(typeof(CheckConfig));

        window.position = new Rect((Screen.currentResolution.width - windowWidth) / 2,
                                   (Screen.currentResolution.height - windowHeight) / 2, windowWidth, windowHeight);

        string title = check.result.platform + "配置检查";

        try {
            if (MsdkUtil.isUnityEarlierThan("5.1"))
            {
                PropertyInfo info = window.GetType().GetProperty("title");
                info.SetValue(window, title, null);
            }
            else
            {
                PropertyInfo info = window.GetType().GetProperty("titleContent");
                info.SetValue(window, new GUIContent(title), null);
            }
        } catch (Exception e) {
            Debug.LogException(e);
        }

        window.Show();
    }