Exemplo n.º 1
0
        public static void HandlePostInstall()
        {
            // Remove from the Editor update loop; we only need this to run once.
            EditorApplication.update -= HandlePostInstall;

            // Check if user just installed or upgraded Poly Toolkit.
            string upgradeFilePath = Path.Combine(Path.Combine(Path.Combine(Application.dataPath,
                                                                            "PolyToolkit"), "Editor"), "upgrade.dat");
            string currentVersion = "";
            bool   isUpgrade      = false;

            try {
                currentVersion = File.ReadAllText(upgradeFilePath).Trim();
            } catch (Exception) {}
            if (currentVersion != PtSettings.Version.ToString())
            {
                isUpgrade = !string.IsNullOrEmpty(currentVersion);
                // Show the welcome window.
                WelcomeWindow.ShowWelcomeWindow();
                AssetBrowserWindow.BrowsePolyAssets();
                File.WriteAllText(upgradeFilePath, PtSettings.Version.ToString());
            }

            // In the future, if we need to do any post-upgrade maintenance, we can add it here.
            PtAnalytics.SendEvent(isUpgrade ? PtAnalytics.Action.INSTALL_UPGRADE
      : PtAnalytics.Action.INSTALL_NEW, PtSettings.Version.ToString());
        }
Exemplo n.º 2
0
    static void ShowWindow()
    {
        if (_thisInstance == null)
        {
            _thisInstance         = EditorWindow.GetWindow(typeof(AssetBrowserWindow), false, "资源浏览工具", true) as AssetBrowserWindow;
            _thisInstance.minSize = new Vector2(600, 600);
        }

        _thisInstance.Show();
    }
Exemplo n.º 3
0
        protected virtual void handleBrowseButtonClicked(Sleek2ImageButton button)
        {
            AssetReference <T> reference = (AssetReference <T>)base.inspectable.value;
            Asset asset = Assets.find <T>(reference);

            if (asset != null)
            {
                AssetBrowserWindow.browse(asset.directory);
            }
        }