using UnityEditor;
using UnityEngine;
public class BuildScript
{
[MenuItem("Build/Build Prototype 1")]
public static void BuildPrototype1()
{
Build("com.companyname.prototype1", "Builds/Prototype1", "Prototype 1");
}
[MenuItem("Build/Build Prototype 2")]
public static void BuildPrototype2()
{
Build("com.companyname.prototype2", "Builds/Prototype2", "Prototype 2");
}
private static void Build(string bundleIdentifier, string outputPath, string productName)
{
// Set the Bundle Identifier
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, bundleIdentifier);
// Set the Product Name (Display Name)
PlayerSettings.productName = productName;
BuildPipeline.BuildPlayer(
new string[] { "Assets/Scenes/MainScene.unity" }, // Replace with your scene paths
outputPath,
BuildTarget.iOS,
BuildOptions.None
);
Debug.Log($"Build completed for {bundleIdentifier} with display name '{productName}'");
}
}