//----------------------------------------------------------------------------------------------------------------------    

    internal static string GetInstallInfoPath(DCCToolInfo info) {
        string localAppDataFolder = null;
        
        switch (Application.platform) {
            case RuntimePlatform.WindowsEditor: {
                localAppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                break;
            }
            case RuntimePlatform.OSXEditor: {
                string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
                localAppDataFolder = Path.Combine(userProfile, "Library/Application Support");
                break;
            }
            case RuntimePlatform.LinuxEditor: {
                string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
                localAppDataFolder = Path.Combine(userProfile, ".config/unity3d");
                break;
            }
            default: {
                throw new NotImplementedException();
            }
        }

        string desc = info.GetDescription().Replace(' ', '_');
        string installInfoFolder = Path.Combine(localAppDataFolder, "Unity", "MeshSync");
        return Path.Combine(installInfoFolder, $"UnityMeshSyncInstallInfo_{desc}.json");
    }
Exemple #2
0
//----------------------------------------------------------------------------------------------------------------------
        protected override void FinalizeDCCConfigurationV()
        {
            DCCToolInfo dccToolInfo = GetDCCToolInfo();

            EditorUtility.DisplayDialog("MeshSync",
                                        $"Launching {dccToolInfo.GetDescription()} for finalizing configuration",
                                        "Ok"
                                        );
        }
Exemple #3
0
//----------------------------------------------------------------------------------------------------------------------
        protected override void FinalizeDCCConfigurationV()
        {
            DCCToolInfo dccToolInfo = GetDCCToolInfo();

            EditorUtility.DisplayDialog("MeshSync",
                                        $"MeshSync plugin installed for {dccToolInfo.GetDescription()}",
                                        "Ok"
                                        );
        }
//----------------------------------------------------------------------------------------------------------------------

        private void AddDCCToolSettingsContainer(DCCToolInfo dccToolInfo, VisualElement top, VisualTreeAsset dccToolInfoTemplate)
        {
            string            desc      = dccToolInfo.GetDescription();
            TemplateContainer container = dccToolInfoTemplate.CloneTree();
            Label             nameLabel = container.Query <Label>("DCCToolName").First();

            nameLabel.text = desc;

            //Load icon
            Texture2D iconTex = LoadIcon(dccToolInfo.IconPath);

            if (null != iconTex)
            {
                container.Query <Image>("DCCToolImage").First().image = iconTex;
            }
            else
            {
                container.Query <Label>("DCCToolImageLabel").First().text = desc[0].ToString();
            }

            container.Query <Label>("DCCToolPath").First().text = "Path: " + dccToolInfo.AppPath;
            BaseDCCIntegrator integrator = DCCIntegratorFactory.Create(dccToolInfo);

            Label statusLabel = container.Query <Label>("DCCToolStatus").First();

            statusLabel.userData = integrator;
            UpdateDCCPluginStatusLabel(statusLabel);

            m_dccStatusLabels[dccToolInfo.AppPath] = statusLabel;
            m_dccContainers[dccToolInfo.AppPath]   = container;


            //Buttons
            {
                Button button = container.Query <Button>("LaunchDCCToolButton").First();
                button.clickable.clickedWithEventInfo += OnLaunchDCCToolButtonClicked;
                button.userData = dccToolInfo;
            }
            {
                Button button = container.Query <Button>("InstallPluginButton").First();
                button.clickable.clickedWithEventInfo += OnInstallPluginButtonClicked;
                button.userData = integrator;
                button.SetEnabled(m_checkPluginUpdatesButton.enabledSelf);
                m_installPluginButtons.Add(button);
            }
            {
                Button button = container.Query <Button>("RemoveDCCToolButton").First();
                button.clickable.clickedWithEventInfo += OnRemoveDCCToolButtonClicked;
                button.userData = dccToolInfo;
            }



            top.Add(container);
        }
//----------------------------------------------------------------------------------------------------------------------

        void AddDCCToolSettingsContainer(DCCToolInfo dccToolInfo, VisualElement top, VisualTreeAsset dccToolInfoTemplate)
        {
            string            desc      = dccToolInfo.GetDescription();
            TemplateContainer container = dccToolInfoTemplate.CloneTree();
            Label             nameLabel = container.Query <Label>("DCCToolName").First();

            nameLabel.text = desc;

            //Load icon
            Texture2D iconTex = LoadIcon(dccToolInfo.IconPath);

            if (null != iconTex)
            {
                container.Query <Image>("DCCToolImage").First().image = iconTex;
            }
            else
            {
                container.Query <Label>("DCCToolImageLabel").First().text = desc[0].ToString();
            }

            container.Query <Label>("DCCToolPath").First().text = "Path: " + dccToolInfo.AppPath;

            BaseDCCIntegrator    integrator  = DCCIntegratorFactory.Create(dccToolInfo);
            DCCPluginInstallInfo installInfo = integrator.FindInstallInfo();

            Label statusLabel = container.Query <Label>("DCCToolStatus").First();

            if (null == installInfo || string.IsNullOrEmpty(installInfo.PluginVersion))
            {
                statusLabel.text = "MeshSync Plugin not installed";
            }
            else
            {
                statusLabel.AddToClassList("plugin-installed");
                statusLabel.text = "MeshSync Plugin installed. Version: " + installInfo.PluginVersion;
            }

            //Buttons
            {
                Button button = container.Query <Button>("RemoveDCCToolButton").First();
                button.clickable.clickedWithEventInfo += OnRemoveDCCToolButtonClicked;
                button.userData = dccToolInfo;
            }


            {
                Button button = container.Query <Button>("InstallPluginButton").First();
                button.clickable.clickedWithEventInfo += OnInstallPluginButtonClicked;
                button.userData = integrator;
            }

            top.Add(container);
        }
Exemple #6
0
//----------------------------------------------------------------------------------------------------------------------
        protected override void FinalizeDCCConfigurationV()
        {
            DCCToolInfo dccToolInfo = GetDCCToolInfo();

            EditorUtility.DisplayDialog("MeshSync",
                                        $"MeshSync plugin configured. Please restart {dccToolInfo.GetDescription()} to complete the installation.",
                                        "Ok"
                                        );
        }