Beispiel #1
0
    private void OnGUI_Compiler()
    {
        GUILayout.Label("Compiler", EditorStyles.boldLabel);

        LoadUniversalCompilerSettings();
        UniversalCompilerSettings ucs;

        ucs.Compiler = (CompilerType)EditorGUILayout.EnumPopup("Compiler:", _ucs.Compiler);
        if (ucs.Equals(_ucs) == false)
        {
            _ucs = ucs;
            SaveUniversalCompilerSettings();
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Version", GetUniversalCompilerVersion());
        EditorGUI.BeginDisabledGroup(!File.Exists(UcLogFilePath));
        if (GUILayout.Button("Log"))
        {
            ShowUniversalCompilerClientLog();
        }
        EditorGUI.EndDisabledGroup();
        EditorGUILayout.EndHorizontal();

        var durations = GetUniversalCompilerLastBuildLogs();

        GUILayout.Label("Last Build Time");
        EditorGUI.indentLevel += 1;
        for (var i = 0; i < BuildTargets.Length; i++)
        {
            EditorGUILayout.LabelField("Assembly" + BuildTargets[i].Substring(15), durations[i]);
        }
        EditorGUI.indentLevel -= 1;
    }
Beispiel #2
0
    private void LoadUniversalCompilerSettings()
    {
        var ucsLastWriteTime = GetFileLastWriteTime(UcsFilePath);

        if (_ucsLastWriteTime == ucsLastWriteTime)
        {
            return;
        }

        try
        {
            using (var fs = new FileStream(UcsFilePath, FileMode.Open, FileAccess.Read))
            {
                var xdoc = XDocument.Load(fs).Element("Settings");
                _ucs = new UniversalCompilerSettings
                {
                    Compiler = (CompilerType)Enum.Parse(typeof(CompilerType), xdoc.Element("Compiler").Value),
                };
                _ucsLastWriteTime = ucsLastWriteTime;
            }
        }
        catch (FileNotFoundException)
        {
        }
        catch (Exception e)
        {
            Debug.LogWarning("LoadUniversalCompilerSettings:" + e);
        }
    }
    private void OnGUI_Compiler()
    {
        GUILayout.Label("Compiler", EditorStyles.boldLabel);

        LoadUniversalCompilerSettings();
        UniversalCompilerSettings ucs;
        ucs.Compiler = (CompilerType)EditorGUILayout.EnumPopup("Compiler:", _ucs.Compiler);
        if (ucs.Equals(_ucs) == false)
        {
            _ucs = ucs;
            SaveUniversalCompilerSettings();
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Version", GetUniversalCompilerVersion());
        if (GUILayout.Button("Log"))
            ShowUniversalCompilerClientLog();
        EditorGUILayout.EndHorizontal();

        var durations = GetUniversalCompilerLastBuildLogs();
        GUILayout.Label("Last Build Time");
        EditorGUI.indentLevel += 1;
        for (var i=0; i< BuildTargets.Length; i++)
            EditorGUILayout.LabelField("Assembly" + BuildTargets[i].Substring(15), durations[i]);
        EditorGUI.indentLevel -= 1;
    }
    private void LoadUniversalCompilerSettings()
    {
        var ucsLastWriteTime = GetFileLastWriteTime(UcsFilePath);
        if (_ucsLastWriteTime == ucsLastWriteTime)
            return;

        try
        {
            using (var fs = new FileStream(UcsFilePath, FileMode.Open, FileAccess.Read))
            {
                var xdoc = XDocument.Load(fs).Element("Settings");
                _ucs = new UniversalCompilerSettings
                {
                    Compiler = (CompilerType)Enum.Parse(typeof (CompilerType), xdoc.Element("Compiler").Value),
                };
                _ucsLastWriteTime = ucsLastWriteTime;
            }
        }
        catch (FileNotFoundException)
        {
        }
        catch (Exception e)
        {
            Debug.LogWarning("LoadUniversalCompilerSettings:" + e);
        }
    }