Ejemplo n.º 1
0
        static void Open()
        {
            UniPMWindow frameworkConfigEditorWindow = (UniPMWindow)GetWindow(typeof(UniPMWindow), true);

            frameworkConfigEditorWindow.titleContent = new GUIContent("UniPM");
            frameworkConfigEditorWindow.position     = new Rect(Screen.width / 2, Screen.height / 2, 800, 600f);
            frameworkConfigEditorWindow.LocalConfig  = PackageListConfig.GetInstalledPackageList();
            frameworkConfigEditorWindow.Init();
            frameworkConfigEditorWindow.Show();
        }
Ejemplo n.º 2
0
        public UIInstalledPackageListPage(PackageListConfig localConfig)
        {
            ScrollView scrollView = new ScrollView();

            scrollView.Width  = 800;
            scrollView.Height = 600f;

            VerticalView verticalView = new VerticalView();

            verticalView.AddChild(new SpaceView());

            HorizontalView gitHorizontalView = new HorizontalView();

            LabelView labelView = new LabelView("Git Url:", 50, 30);

            labelView.FontColor = Color.white;
            gitHorizontalView.AddChild(labelView);
            TextField gitUrl = new TextField(PackageListConfig.GitUrl);

            gitUrl.OnTextChanged += text =>
            {
                PackageListConfig.GitUrl = text;
            };

            gitHorizontalView.AddChild(gitUrl);

            verticalView.AddChild(gitHorizontalView);

            HorizontalView horizontalView = new HorizontalView();

            horizontalView.AddChild(UIFactory.CreateTitleLabel("package name"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("version"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("release notes"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("folder"));

            verticalView.AddChild(horizontalView);
            scrollView.AddChild(verticalView);

            foreach (var localConfigPluginInfo in localConfig.InstalledPackageList)
            {
                var scrollItem = new HorizontalView();

                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.Name));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(string.Format("v{0}", localConfigPluginInfo.Version)));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.ReleaseNote));
                scrollItem.AddChild(new ButtonView("Download", 65, 25, () => UniPMWindow.DownloadZip(localConfigPluginInfo)));
                scrollView.AddChild(scrollItem);
            }

            scrollView.AddChild(new FlexibaleSpaceView());

            AddChild(scrollView);
        }
Ejemplo n.º 3
0
        public UIOnlinePackageListPage(PackageListConfig remoteConfig)
        {
            ScrollView scrollView = new ScrollView();

            scrollView.Width  = 800;
            scrollView.Height = 600f;

            VerticalView verticalView = new VerticalView();

            verticalView.AddChild(new SpaceView());

            HorizontalView horizontalView = new HorizontalView();

            horizontalView.AddChild(UIFactory.CreateTitleLabel("package name"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("version"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("release notes"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("folder"));

            verticalView.AddChild(horizontalView);
            scrollView.AddChild(verticalView);

            foreach (var localConfigPluginInfo in remoteConfig.InstalledPackageList)
            {
                var scrollItem = new HorizontalView();

                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.Name));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(string.Format("v{0}", localConfigPluginInfo.Version)));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.ReleaseNote));
                scrollItem.AddChild(new ButtonView("Download", 65, 25, () => UniPMWindow.DownloadZip(localConfigPluginInfo)));

                scrollView.AddChild(scrollItem);
            }

            scrollView.AddChild(new FlexibaleSpaceView());

            AddChild(scrollView);
        }