Esempio n. 1
0
        private OverrideDestinationSpec OverrideDestinationField(OverrideDestinationSpec spec)
        {
            OverrideDestinationSpec temp = spec;

            temp.Type     = (InstallSpecType)EditorGUILayout.EnumPopup("Type to skip", temp.Type);
            temp.Location = EditorGUILayout.TextField("Overriden location", temp.Location);
            return(temp);
        }
Esempio n. 2
0
        private DependencyDefinition DependencyField(DependencyDefinition def)
        {
            DependencyDefinition temp = def;

            EditorGUILayout.BeginVertical();
            EditorGUILayout.BeginHorizontal();
            temp.Name    = EditorGUILayout.TextField("Package Name:", temp.Name);
            temp.Version = EditorGUILayout.TextField("Package Version:", temp.Version);
            EditorGUILayout.EndHorizontal();
            OverrideDestinationSpec defaultODS = new OverrideDestinationSpec {
                Type = InstallSpecType.Base, Location = "Enter a location"
            };
            SkipInstallSpec defaultSIS = new SkipInstallSpec {
                Type = InstallSpecType.Docs
            };

            if (temp.OverrideDestination != null)
            {
                temp.OverrideDestination = ArrayField <OverrideDestinationSpec>(
                    temp.OverrideDestination,
                    "Do not override this",
                    "Override another type",
                    defaultODS,
                    ods => OverrideDestinationField(ods)
                    );
            }
            else
            {
                if (GUILayout.Button("Declare some installation overrides"))
                {
                    temp.OverrideDestination = new OverrideDestinationSpec[] { defaultODS };
                }
            }
            if (temp.SkipInstall != null)
            {
                temp.SkipInstall = ArrayField <SkipInstallSpec>(
                    temp.SkipInstall,
                    "Do not skip this",
                    "Skip another type",
                    defaultSIS,
                    sis => SkipInstallField(sis)
                    );
            }
            else
            {
                if (GUILayout.Button("Declare some installation skips"))
                {
                    temp.SkipInstall = new SkipInstallSpec[] { defaultSIS };
                }
            }
            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();

            return(temp);
        }