Exemple #1
0
        private void RenderBaseDeploymentConfig(BaseDeploymentConfig source, BaseDeploymentConfig dest)
        {
            using (new EditorGUI.DisabledScope(source is SimulatedPlayerDeploymentConfig))
            {
                dest.Name = EditorGUILayout.TextField("Deployment Name", source.Name);
            }

            dest.SnapshotPath = EditorGUILayout.TextField("Snapshot Path", source.SnapshotPath);
            dest.LaunchJson   = EditorGUILayout.TextField("Launch Config", source.LaunchJson);
            dest.Region       = (DeploymentRegionCode)EditorGUILayout.EnumPopup("Region", source.Region);

            EditorGUILayout.LabelField("Tags");

            using (new EditorGUI.IndentLevelScope())
            {
                for (var i = 0; i < dest.Tags.Count; i++)
                {
                    dest.Tags[i] = EditorGUILayout.TextField($"Tag #{i + 1}", dest.Tags[i]);
                }

                dest.Tags.Add(EditorGUILayout.TextField($"Tag #{dest.Tags.Count + 1}", string.Empty));

                dest.Tags = dest.Tags.Where(tag => !string.IsNullOrEmpty(tag)).ToList();
            }
        }
Exemple #2
0
        private void RenderBaseDeploymentConfig(BaseDeploymentConfig source, BaseDeploymentConfig dest)
        {
            using (new EditorGUI.DisabledScope(source is SimulatedPlayerDeploymentConfig))
            {
                dest.Name = EditorGUILayout.TextField("Deployment Name", source.Name);
            }

            dest.SnapshotPath = EditorGUILayout.TextField("Snapshot Path", source.SnapshotPath);
            dest.LaunchJson   = EditorGUILayout.TextField("Launch Config", source.LaunchJson);

            var foldoutState = stateManager.GetStateObjectOrDefault <bool>($"{source.Name}region".GetHashCode());

            foldoutState = EditorGUILayout.Foldout(foldoutState, new GUIContent("Deployment location"));
            stateManager.SetStateObject($"{source.Name}region".GetHashCode(), foldoutState);

            if (foldoutState)
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    using (new GUILayout.HorizontalScope())
                    {
                        if (EditorGUILayout.Toggle("Region",
                                                   source.DeploymentLocationType == DeploymentLocationType.Region, EditorStyles.radioButton))
                        {
                            dest.DeploymentLocationType = DeploymentLocationType.Region;
                        }

                        using (new EditorGUI.DisabledScope(dest.DeploymentLocationType == DeploymentLocationType.Cluster))
                        {
                            dest.Region = (DeploymentRegionCode)EditorGUILayout.EnumPopup(source.Region);
                        }
                    }

                    using (new GUILayout.HorizontalScope())
                    {
                        if (EditorGUILayout.Toggle("Cluster",
                                                   dest.DeploymentLocationType == DeploymentLocationType.Cluster, EditorStyles.radioButton))
                        {
                            dest.DeploymentLocationType = DeploymentLocationType.Cluster;
                        }

                        using (new EditorGUI.DisabledScope(dest.DeploymentLocationType == DeploymentLocationType.Region))
                        {
                            dest.Cluster = EditorGUILayout.TextField(source.Cluster);
                        }
                    }
                }
            }

            EditorGUILayout.LabelField("Tags");

            using (new EditorGUI.IndentLevelScope())
            {
                for (var i = 0; i < dest.Tags.Count; i++)
                {
                    dest.Tags[i] = EditorGUILayout.TextField($"Tag #{i + 1}", dest.Tags[i]);
                }

                dest.Tags.Add(EditorGUILayout.TextField($"Tag #{dest.Tags.Count + 1}", string.Empty));

                dest.Tags = dest.Tags.Where(tag => !string.IsNullOrEmpty(tag)).ToList();
            }
        }
 public DeploymentConfig()
 {
     AssemblyName = string.Empty;
     Deployment   = new BaseDeploymentConfig();
     SimulatedPlayerDeploymentConfigs = new List <SimulatedPlayerDeploymentConfig>();
 }
 public void Launch(string projectName, string assemblyName, BaseDeploymentConfig config,
                    QueueMode mode = QueueMode.Enqueue)
 {
     AddTask(mode, () => Deployment.LaunchAsync(projectName, assemblyName, config));
 }