コード例 #1
0
 void DrawBuildReportWarnings()
 {
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("Open report window", GUILayout.Height(24)))
     {
         ReportWindow.Open();
     }
     GUILayout.FlexibleSpace();
     GUILayout.EndHorizontal();
 }
コード例 #2
0
        /// <summary>
        /// Our build setup, a default WebGL setup without developer mode.
        /// </summary>
        /// <returns></returns>
        private static BuildReport DefaultBuild()
        {
            var reportCount = RunFullReport();

            if (reportCount > 0)
            {
                var res = EditorUtility.DisplayDialogComplex("Report",
                                                             string.Format("Trail Report has identified {0} critical issue{1} with your build.", reportCount, reportCount > 1 ? "s" : ""),
                                                             "Open report window", "Cancel", "Build anyway");
                if (res == 0)
                {
                    ReportWindow.Open();
                    return(null);
                }
                if (res == 1)
                {
                    return(null);
                }
            }

            if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.WebGL)
            {
                EditorUtility.DisplayDialog("Build Failed", "Wrong platform selected! Select WebGL before attempting to build for Trail.", "Ok");
                return(null);
            }

            BuildPlayerOptions options = new BuildPlayerOptions();

            options.scenes = EditorBuildSettings.scenes
                             .Where(x => x.enabled)
                             .Select(x => x.path)
                             .ToArray();

            options.target           = BuildTarget.WebGL;
            options.targetGroup      = BuildTargetGroup.WebGL;
            options.options          = BuildOptions.ShowBuiltPlayer;
            options.locationPathName = TrailEditor.BuildTrailPath;

            return(UnityEditor.BuildPipeline.BuildPlayer(options));
        }
コード例 #3
0
 /// <summary>
 /// This will run a full report to verify how many required issues in need to fix before uploading to Trail.
 /// </summary>
 /// <returns></returns>
 public static int RunFullReport()
 {
     return(ReportWindow.RunFullReport());
 }