void DrawSelectedSequenceData()
    {
        EditorGUILayout.Space(20);

        if (sequenceList.index < 0 || sequenceList.index >= settings.sequences.Count)
        {
            buildList = null;
            return;
        }

        if (buildList == null)
        {
            buildList = BuildDataReordableList.Create(settings.sequences[sequenceList.index].builds, OnBuildAdd, "Builds");
            buildList.onSelectCallback += OnBuildSelectionChanged;;
            buildList.index             = 0;
        }

        buildList.DoLayoutList();

        if (buildList.index < 0 || buildList.index >= settings.sequences[sequenceList.index].builds.Count)
        {
            return;
        }

        BuildData selected = settings.sequences[sequenceList.index].builds[buildList.index];

        SerializedObject obj = new SerializedObject(settings);

        selected.isPassbyBuild             = EditorGUILayout.Toggle("Is Passby build", selected.isPassbyBuild);
        selected.isReleaseBuild            = EditorGUILayout.Toggle("Is Release build", selected.isReleaseBuild);
        selected.isVirtualRealitySupported = EditorGUILayout.Toggle("VR Supported", selected.isVirtualRealitySupported);

        EditorGUILayout.Space(20);
        selected.outputRoot            = EditorGUILayout.TextField("Output root", selected.outputRoot);
        selected.middlePath            = EditorGUILayout.TextField("Middle path", selected.middlePath);
        selected.dirPathForPostProcess = EditorGUILayout.TextField("Dir path", selected.dirPathForPostProcess);

        EditorGUILayout.BeginHorizontal();
        selected.scriptingDefineSymbolsOverride = EditorGUILayout.TextField("Defines build override", selected.scriptingDefineSymbolsOverride);
        if (GUILayout.Button($"Set defines", GUILayout.Width(100f)))
        {
            PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget), string.Concat(settings.scriptingDefineSymbols, ";", settings.sequences[sequenceList.index].scriptingDefineSymbolsOverride, ";", selected.scriptingDefineSymbolsOverride));
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space(20);
        postBuildFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(postBuildFoldout, "Post build processing");
        if (postBuildFoldout)
        {
            ++EditorGUI.indentLevel;
            selected.needZip        = EditorGUILayout.Toggle("Compress", selected.needZip);
            selected.needGithubPush = EditorGUILayout.Toggle("Push to github releases", selected.needGithubPush);
            if (selected.needGithubPush && !selected.needZip)
            {
                selected.needZip = true;
                Debug.Log(".zip must be created before pushing to GitHub releases");
            }

            EditorGUILayout.LabelField("itch.io:");
            ++EditorGUI.indentLevel;
            selected.needItchPush = EditorGUILayout.Toggle("Push to itch.io", selected.needItchPush);
            selected.itchChannel  = EditorGUILayout.TextField("Channel", selected.itchChannel);
            --EditorGUI.indentLevel;

            --EditorGUI.indentLevel;
        }
        EditorGUILayout.EndFoldoutHeaderGroup();
    }
예제 #2
0
    void DrawSelectedSequenceData()
    {
        EditorGUILayout.Space(20);

        if (sequenceList.index < 0 || sequenceList.index >= settings.sequences.Count)
        {
            buildList = null;
            return;
        }

        if (buildList == null)
        {
            buildList = BuildDataReordableList.Create(settings.sequences[sequenceList.index].builds, OnBuildAdd, "Builds");
            buildList.onSelectCallback += OnBuildSelectionChanged;;
            buildList.index             = 0;
        }

        buildList.DoLayoutList();

        if (buildList.index < 0 || buildList.index >= settings.sequences[sequenceList.index].builds.Count)
        {
            return;
        }

        BuildData selected = settings.sequences[sequenceList.index].builds[buildList.index];

        SerializedObject obj = new SerializedObject(settings);

        selected.isPassbyBuild             = EditorGUILayout.Toggle("Is Passby build", selected.isPassbyBuild);
        selected.isReleaseBuild            = EditorGUILayout.Toggle("Is Release build", selected.isReleaseBuild);
        selected.isVirtualRealitySupported = EditorGUILayout.Toggle("VR Supported", selected.isVirtualRealitySupported);

        EditorGUILayout.Space(20);
        selected.outputRoot = EditorGUILayout.TextField("Output root", selected.outputRoot);
        selected.middlePath = EditorGUILayout.TextField("Middle path", selected.middlePath);

        EditorGUILayout.BeginHorizontal();
        selected.scriptingDefineSymbolsOverride = EditorGUILayout.TextField("Defines build override", selected.scriptingDefineSymbolsOverride);
        if (GUILayout.Button($"Set defines", GUILayout.Width(100f)))
        {
            PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget), string.Concat(settings.scriptingDefineSymbols, ";", settings.sequences[sequenceList.index].scriptingDefineSymbolsOverride, ";", selected.scriptingDefineSymbolsOverride));
        }
        EditorGUILayout.EndHorizontal();

        //EditorGUILayout.BeginHorizontal();
        //EditorGUILayout.LabelField("Build Target Group", GUILayout.MinWidth(0));
        //selected.targetGroup = (BuildTargetGroup)EditorGUILayout.EnumPopup(selected.targetGroup);
        //EditorGUILayout.EndHorizontal();

        //EditorGUILayout.BeginHorizontal();
        //EditorGUILayout.LabelField("Build Target", GUILayout.MinWidth(0));
        //selected.target = (BuildTarget)EditorGUILayout.EnumPopup(selected.target);
        //EditorGUILayout.EndHorizontal();

        //EditorGUILayout.BeginHorizontal();
        //EditorGUILayout.LabelField("Build Options", GUILayout.MinWidth(0));
        //selected.options = (BuildOptions)EditorGUILayout.EnumFlagsField(selected.options);
        //EditorGUILayout.EndHorizontal();
        //EditorGUILayout.Space(20);


        EditorGUILayout.Space(20);
        zipFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(zipFoldout, "7zip");
        if (zipFoldout)
        {
            ++EditorGUI.indentLevel;
            selected.needZip         = EditorGUILayout.Toggle("Compress", selected.needZip);
            selected.compressDirPath = EditorGUILayout.TextField("Dir path", selected.compressDirPath);
            --EditorGUI.indentLevel;
        }
        EditorGUILayout.EndFoldoutHeaderGroup();

        itchFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(itchFoldout, "itch.io");
        if (itchFoldout)
        {
            ++EditorGUI.indentLevel;
            selected.needItchPush = EditorGUILayout.Toggle("Push to itch.io", selected.needItchPush);
            selected.itchDirPath  = EditorGUILayout.TextField("Dir path", selected.itchDirPath);
            selected.itchChannel  = EditorGUILayout.TextField("Channel", selected.itchChannel);
            selected.itchAddLastChangelogUpdateNameToVerison = EditorGUILayout.Toggle("Add Changelog Update Name To Verison", selected.itchAddLastChangelogUpdateNameToVerison);
            --EditorGUI.indentLevel;
        }
        EditorGUILayout.EndFoldoutHeaderGroup();

        EditorUtility.SetDirty(settings);
    }