| Parameter | Description |
|---|---|
| platformId | The GUID of the target platform. Must be a valid platform installed in the Unity Editor. |
| profileName | The name for the build profile. Used as the asset filename. |
| onProfileReady | Optional callback invoked when the profile completes initialization and is ready to use. The callback must be static or on a serialized UnityEngine.Object to survive domain reloads. Non-persistent callbacks fail to invoke if a domain reload occurs during initialization. |
BuildProfile The newly created BuildProfile instance. The profile may require initialization if platform packages need to be installed.
Creates a new build profile asset for the specified platform with the provided name and places it under Assets/Settings/BuildProfiles.
This method automatically installs required platform packages if they are not already installed. Package installation happens asynchronously and begins immediately.
Unity creates the profile at: Assets/Settings/Build Profiles/{profileName}.asset. If a profile with the same name exists, a unique name is generated.
//Static method example - will continue after a domain reload BuildProfile profile = BuildProfile.CreateBuildProfile( androidGuid, "My Profile", OnProfileReadyStatic);
static void OnProfileReadyStatic(BuildProfile profile) { Debug.Log($"Profile {profile.name} ready!"); }
Use BuildProfile.GetInstalledPlatformModules to fetch installed platform identifiers.