public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        GUILayout.Space(25);
        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Reimport All", GUILayout.MaxWidth(175), GUILayout.MinHeight(20)))
        {
            NoesisPostprocessor.ImportAllAssets();
        }

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
    }
예제 #2
0
    private IEnumerator UpdateVersion()
    {
        GoogleAnalyticsHelper.LogEvent("Install", version_, 0);
        progress_ = 0.10f;

        state_ = "Upgrading project";
        yield return(null);

        Upgrade(localVersion_);
        progress_ = 0.20f;

        state_ = "Updating version";
        yield return(null);

        NoesisVersion.SetCached(version_);
        progress_ = 0.35f;

        state_ = "Creating default settings";
        yield return(null);

        NoesisSettings.Get();
        progress_ = 0.40f;

        state_ = "Extracting documentation...\n";
        yield return(null);

        ExtractDocumentation();
        progress_ = 0.60f;

        state_ = "Importing assets...\n";
        yield return(null);

        NoesisPostprocessor.ImportAllAssets();
        progress_ = 0.90f;

        state_ = "Opening Welcome Window...\n";
        yield return(null);

        EditorWindow.GetWindow(typeof(NoesisWelcome), true, "Welcome to NoesisGUI!");
        progress_ = 1.0f;

        Debug.Log("NoesisGUI v" + version_ + " successfully installed");
    }
예제 #3
0
 public static void ImportAllAssets()
 {
     NoesisPostprocessor.ImportAllAssets((progress, asset) => EditorUtility.DisplayProgressBar("Reimport All XAMLs", asset, progress));
     EditorUtility.ClearProgressBar();
 }
예제 #4
0
    public static void OnInspectorGUI(SerializedObject settings)
    {
        EditorGUILayout.PropertyField(settings.FindProperty("licenseName"));
        EditorGUILayout.PropertyField(settings.FindProperty("licenseKey"));

        GUILayout.Space(10);
        EditorGUILayout.PropertyField(settings.FindProperty("applicationResources"));

        GUILayout.Space(10);
        EditorGUILayout.PropertyField(settings.FindProperty("defaultFont"));
        EditorGUILayout.PropertyField(settings.FindProperty("defaultFontSize"));
        EditorGUILayout.PropertyField(settings.FindProperty("defaultFontWeight"));
        EditorGUILayout.PropertyField(settings.FindProperty("defaultFontStretch"));
        EditorGUILayout.PropertyField(settings.FindProperty("defaultFontStyle"));

        EditorGUILayout.PropertyField(settings.FindProperty("glyphTextureSize"));
        EditorGUILayout.PropertyField(settings.FindProperty("offscreenSampleCount"));
        EditorGUILayout.PropertyField(settings.FindProperty("offscreenInitSurfaces"));
        EditorGUILayout.PropertyField(settings.FindProperty("offscreenMaxSurfaces"));
        EditorGUILayout.PropertyField(settings.FindProperty("linearRendering"));

        EditorGUILayout.PropertyField(settings.FindProperty("previewEnabled"));
        EditorGUILayout.PropertyField(settings.FindProperty("hotReloading"));
        EditorGUILayout.PropertyField(settings.FindProperty("debugImporter"));
        EditorGUILayout.PropertyField(settings.FindProperty("logVerbosity"));

        GUILayout.Space(10);
        GUILayout.Label("Native Memory", EditorStyles.boldLabel);
        GUILayout.BeginHorizontal();
        EditorGUILayout.PrefixLabel("Allocated");
        EditorGUILayout.HelpBox(Noesis.Memory.Current.ToString("#,0,. KB"), MessageType.None);
        GUILayout.EndHorizontal();

        GUILayout.Space(10);
        EditorStyles.foldout.fontStyle = FontStyle.Bold;
        _showCursors = EditorGUILayout.Foldout(_showCursors, "Cursors", false, EditorStyles.foldout);
        if (_showCursors)
        {
            EditorStyles.foldout.fontStyle = FontStyle.Normal;
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(settings.FindProperty("AppStarting"), new GUIContent("AppStarting"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Arrow"), new GUIContent("Arrow"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ArrowCD"), new GUIContent("ArrowCD"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Cross"), new GUIContent("Cross"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Hand"), new GUIContent("Hand"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Help"), new GUIContent("Help"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("IBeam"), new GUIContent("IBeam"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("No"), new GUIContent("No"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("None"), new GUIContent("None"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Pen"), new GUIContent("Pen"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollAll"), new GUIContent("ScrollAll"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollE"), new GUIContent("ScrollE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollN"), new GUIContent("ScrollN"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollNE"), new GUIContent("ScrollNE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollNS"), new GUIContent("ScrollNS"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollNW"), new GUIContent("ScrollNW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollS"), new GUIContent("ScrollS"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollSE"), new GUIContent("ScrollSE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollSW"), new GUIContent("ScrollSW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollW"), new GUIContent("ScrollW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollWE"), new GUIContent("ScrollWE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeAll"), new GUIContent("SizeAll"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeNESW"), new GUIContent("SizeNESW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeNS"), new GUIContent("SizeNS"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeNWSE"), new GUIContent("SizeNWSE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeWE"), new GUIContent("SizeWE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("UpArrow"), new GUIContent("UpArrow"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Wait"), new GUIContent("Wait"), true);
            EditorGUI.indentLevel--;
        }

        GUILayout.Space(10);
        EditorGUILayout.HelpBox("(*) Unity restart needed for updates to take effect", MessageType.None);

        GUILayout.Space(20);
        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Reimport All XAMLs", GUILayout.MaxWidth(175), GUILayout.MinHeight(20)))
        {
            NoesisPostprocessor.ImportAllAssets();
        }

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (settings.hasModifiedProperties)
        {
            settings.ApplyModifiedProperties();
            ((NoesisSettings)settings.targetObject).OnSave();
        }
    }
예제 #5
0
    public static void OnInspectorGUI(SerializedObject settings)
    {
        EditorGUILayout.PropertyField(settings.FindProperty("applicationResources"));

        EditorGUILayout.PropertyField(settings.FindProperty("glyphTextureSize"));
        EditorGUILayout.PropertyField(settings.FindProperty("colorGlyphTextureSize"));
        EditorGUILayout.PropertyField(settings.FindProperty("glyphMeshThreshold"));
        EditorGUILayout.PropertyField(settings.FindProperty("offscreenSampleCount"));
        EditorGUILayout.PropertyField(settings.FindProperty("offscreenInitSurfaces"));
        EditorGUILayout.PropertyField(settings.FindProperty("offscreenMaxSurfaces"));
        EditorGUILayout.PropertyField(settings.FindProperty("linearRendering"));

        EditorGUILayout.PropertyField(settings.FindProperty("previewEnabled"));
        EditorGUILayout.PropertyField(settings.FindProperty("debugImporter"));
        EditorGUILayout.PropertyField(settings.FindProperty("logVerbosity"));

        GUILayout.Space(10);
        EditorStyles.foldout.fontStyle = FontStyle.Bold;
        _showCursors = EditorGUILayout.Foldout(_showCursors, "Cursors", false, EditorStyles.foldout);
        if (_showCursors)
        {
            EditorStyles.foldout.fontStyle = FontStyle.Normal;
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(settings.FindProperty("AppStarting"), new GUIContent("AppStarting"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Arrow"), new GUIContent("Arrow"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ArrowCD"), new GUIContent("ArrowCD"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Cross"), new GUIContent("Cross"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Hand"), new GUIContent("Hand"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Help"), new GUIContent("Help"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("IBeam"), new GUIContent("IBeam"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("No"), new GUIContent("No"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("None"), new GUIContent("None"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Pen"), new GUIContent("Pen"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollAll"), new GUIContent("ScrollAll"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollE"), new GUIContent("ScrollE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollN"), new GUIContent("ScrollN"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollNE"), new GUIContent("ScrollNE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollNS"), new GUIContent("ScrollNS"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollNW"), new GUIContent("ScrollNW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollS"), new GUIContent("ScrollS"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollSE"), new GUIContent("ScrollSE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollSW"), new GUIContent("ScrollSW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollW"), new GUIContent("ScrollW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("ScrollWE"), new GUIContent("ScrollWE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeAll"), new GUIContent("SizeAll"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeNESW"), new GUIContent("SizeNESW"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeNS"), new GUIContent("SizeNS"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeNWSE"), new GUIContent("SizeNWSE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("SizeWE"), new GUIContent("SizeWE"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("UpArrow"), new GUIContent("UpArrow"), true);
            EditorGUILayout.PropertyField(settings.FindProperty("Wait"), new GUIContent("Wait"), true);
            EditorGUI.indentLevel--;
        }

        GUILayout.Space(10);
        EditorGUILayout.HelpBox("(*) Unity restart needed for updates to take effect", MessageType.None);

        GUILayout.Space(20);
        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Reimport All XAMLs", GUILayout.MaxWidth(175), GUILayout.MinHeight(20)))
        {
            NoesisPostprocessor.ImportAllAssets();
        }

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        settings.ApplyModifiedProperties();
    }
예제 #6
0
    private static void CheckVersion()
    {
        EditorApplication.update -= CheckVersion;

        if (!UnityEditorInternal.InternalEditorUtility.inBatchMode)
        {
            string localVersion = NoesisVersion.GetCached();
            string version      = NoesisVersion.Get();

            // Remove the file that indicates Noesis package is being installed
            AssetDatabase.DeleteAsset("Assets/NoesisGUI/Plugins/Editor/installing");

            // Detect if /Library is being recreated
            string noesisFile             = Path.Combine(Application.dataPath, "../Library/noesis");
            bool   libraryFolderRecreated = !File.Exists(noesisFile);
            if (libraryFolderRecreated)
            {
                File.Create(noesisFile).Dispose();
            }

            if (localVersion != version && version != "0.0.0")
            {
                if (NoesisVersion.RestartNeeded())
                {
                    Debug.LogWarning("Please restart Unity to reload NoesisGUI native plugin! " +
                                     "If error persists remove 'Assets/NoesisGUI/Plugins' and reimport again.");
                    return;
                }

                string title;

                if (localVersion != "")
                {
                    title = "Upgrading NoesisGUI " + localVersion + " -> " + version;
                }
                else
                {
                    title = "Installing NoesisGUI " + version;
                }

                EditorUtility.DisplayProgressBar(title, "", 0.0f);
                GoogleAnalyticsHelper.LogEvent("Install", version, 0);

                EditorUtility.DisplayProgressBar(title, "Upgrading project", 0.10f);
                Upgrade(localVersion);

                EditorUtility.DisplayProgressBar(title, "Updating version", 0.20f);
                NoesisVersion.SetCached(version);

                EditorUtility.DisplayProgressBar(title, "Creating default settings", 0.35f);
                NoesisSettings.Get();

                EditorUtility.DisplayProgressBar(title, "Extracting documentation...", 0.40f);
                ExtractTar("NoesisGUI/Doc.tar", "/../NoesisDoc", "/../NoesisDoc");

                EditorUtility.DisplayProgressBar(title, "Extracting blend samples...", 0.55f);
                ExtractTar("NoesisGUI/Samples/Samples-blend.tar", "/..", "/../Blend");

                NoesisPostprocessor.ImportAllAssets((progress, asset) =>
                {
                    EditorUtility.DisplayProgressBar(title, asset, 0.60f + progress * 0.40f);
                });

                EditorApplication.update += ShowWelcomeWindow;
                EditorUtility.ClearProgressBar();

                Debug.Log("NoesisGUI v" + version + " successfully installed");
            }
            else if (libraryFolderRecreated)
            {
                NoesisPostprocessor.ImportAllAssets();
            }
        }
    }