Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question [Unity.Build] Enable Deep Profiling in Build Configuration

Discussion in 'Entity Component System' started by georgerh, Nov 29, 2022.

  1. georgerh

    georgerh

    Joined:
    Feb 28, 2020
    Posts:
    72
    When using the new build configuration system (Unity.Build), how do you enable deep profiling?

    ClassicBuildCustomizer.ProvideBuildOptions does not take BuildOptions.EnableDeepProfilingSupport into account:
    Code (CSharp):
    1.         public override BuildOptions ProvideBuildOptions()
    2.         {
    3.             var options = BuildOptions.None;
    4.  
    5.             // Build options from build type
    6.             if (Context.TryGetComponent<ClassicBuildProfile>(out var profile))
    7.             {
    8.                 switch (profile.Configuration)
    9.                 {
    10.                     case BuildType.Debug:
    11.                         options |= BuildOptions.AllowDebugging | BuildOptions.Development;
    12.                         break;
    13.                     case BuildType.Develop:
    14.                         options |= BuildOptions.Development;
    15.                         break;
    16.                 }
    17.             }
    18.  
    19.             // Build options from components
    20.             if (Context.HasComponent<AutoRunPlayer>())
    21.                 options |= BuildOptions.AutoRunPlayer;
    22. // DOTS-5792
    23. #pragma warning disable 618
    24.             if (Context.HasComponent<EnableHeadlessMode>())
    25.                 options |= BuildOptions.EnableHeadlessMode;
    26. #pragma warning restore 618
    27.             if (Context.HasComponent<IncludeTestAssemblies>())
    28.                 options |= BuildOptions.IncludeTestAssemblies;
    29.             if (Context.HasComponent<InstallInBuildFolder>())
    30.                 options |= BuildOptions.InstallInBuildFolder;
    31.             if (Context.TryGetComponent<PlayerConnectionSettings>(out PlayerConnectionSettings value))
    32.             {
    33.                 if (value.Mode == PlayerConnectionInitiateMode.Connect)
    34.                     options |= BuildOptions.ConnectToHost;
    35.                 if (value.WaitForConnection)
    36.                     options |= BuildOptions.WaitForPlayerConnection;
    37.             }
    38.  
    39.             if (Context.HasComponent<EnableScriptDebugging>())
    40.                 options |= BuildOptions.AllowDebugging;
    41.             return options;
    42.         }
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    284
    A word of caution: the Platforms package isn't included as a dependency in the latest Entities preview, and Platforms in fact does not have a preview release that coincides with the rest of the Entities packages. You are currently able to build Entities projects normally through the Build Settings window or through the related scripting APIs, and the word on the street is that the Platforms package is being ditched in favor of having a common way to build Unity projects and not having to maintain two different pipelines.
     
  3. georgerh

    georgerh

    Joined:
    Feb 28, 2020
    Posts:
    72
    Thanks for the heads-up, @Spy-Master. Which Entities version do you mean? We are currently on 1.0.0-exp.12 which does have the dependency. Is that not the latest version?
    upload_2022-11-30_11-41-59.png
     
  4. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    284
    The current base Entities package is 1.0.0-pre.15. It only works on 2022.2.0f1 and above, and said editor is only installable via a direct unityhub:// deep link. Whenever 2022.2 comes out of beta, that package or some newer version will be the default to install / use.

    https://docs.unity3d.com/Packages/com.unity.entities@1.0/changelog/CHANGELOG.html#removed
     
  5. georgerh

    georgerh

    Joined:
    Feb 28, 2020
    Posts:
    72
    Ok, thanks for the clarification. Appreciate it!