Exemple #1
0
        public void OnGUI()
        {
            AltVRItemWidgets.BuildSelectorList(_known_items.Values, CreateKit, LoadItems <modelsJSON>, SelectItem, ref m_scrollPosition);

            void CreateKit()
            {
                CreateGLTFWindow window = CreateInstance <CreateGLTFWindow>();

                window.SetCommitAction(() =>
                {
                    AltspaceModelItem new_item = new AltspaceModelItem
                    {
                        itemName    = window.modelName,
                        description = window.description,
                        imageFile   = window.imageFile,
                        itemPath    = window.gltfFile
                    };

                    if (new_item.updateAltVRItem() && LoadSingleItem(new_item.id))
                    {
                        _selected_item          = _known_items[new_item.id];
                        _selected_item.itemPath = _selected_item.suggestedAssetPath;

                        this.Close();
                        GetWindow <LoginManager>().Repaint();
                    }
                });
                window.Show();
            }
        }
Exemple #2
0
        public void OnGUI()
        {
            AltVRItemWidgets.BuildSelectorList(_known_items.Values, CreateKit, LoadItems <kitsJSON>, SelectItem, ref m_scrollPosition);

            void CreateKit()
            {
                CreateKitWindow window = CreateInstance <CreateKitWindow>();

                window.SetCommitAction(() =>
                {
                    AltspaceKitItem new_item = new AltspaceKitItem()
                    {
                        itemName    = window.kitName,
                        description = window.description,
                        imageFile   = window.imageFile
                    };

                    if (new_item.updateAltVRItem() && LoadSingleItem(new_item.id))
                    {
                        _selected_item          = _known_items[new_item.id];
                        _selected_item.itemPath = Path.Combine(
                            SettingsManager.settings.KitsRootDirectory,
                            Common.SanitizeFileName(_selected_item.itemName));

                        this.Close();
                        GetWindow <LoginManager>().Repaint();
                    }
                });
                window.Show();
            }
        }
        public void OnGUI()
        {
            AltVRItemWidgets.BuildSelectorList(_known_items.Values, CreateTemplate, LoadItems <templatesJSON>, SelectItem, ref m_scrollPosition);

            void CreateTemplate()
            {
                CreateTemplateWindow window = CreateInstance <CreateTemplateWindow>();

                window.SetCommitAction(() =>
                {
                    AltspaceTemplateItem new_item = new AltspaceTemplateItem()
                    {
                        itemName    = window.templateName,
                        description = window.description,
                        imageFile   = window.imageFile,
                        tag_list    = window.tag_list
                    };

                    if (new_item.updateAltVRItem() && LoadSingleItem(new_item.id))
                    {
                        _selected_item          = _known_items[new_item.id];
                        _selected_item.itemPath = Path.Combine(
                            "Assets",
                            "Scenes",
                            Common.SanitizeFileName(_selected_item.itemName) + ".unity");

                        this.Close();
                        GetWindow <LoginManager>().Repaint();
                    }
                });
                window.Show();
            }
        }
 protected static void ManageItems(string message)
 {
     AltVRItemWidgets.ManageItem(
         _selected_item,
         () => GetWindow <V>().Show(),
         (string id) => { LoadSingleItem(id); _selected_item = _known_items[id]; },
         message);
 }