DCS/ruiyiweiUX/Assets/GeneralTools/Editor/ProductWindow.cs

40 lines
1.1 KiB
C#
Raw Normal View History

2026-06-09 13:59:11 +08:00
using UnityEngine;
using UnityEditor;
namespace GeneralTools
{
public class ProductWindow : ScriptableWizard
{
public string companyName;
public string productName;
private void OnEnable()
{
productName = PlayerSettings.productName;
companyName = PlayerSettings.companyName;
}
private void OnWizardCreate()
{
SetProduct();
}
private void OnWizardOtherButton()
{
companyName = "FengYuZhu";
productName = Application.productName;
SetProduct();
}
private void SetProduct()
{
PlayerSettings.companyName = companyName;
PlayerSettings.productName = productName;
string identifier = string.Format("com.{0}.{1}", companyName, productName);
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Standalone, identifier);
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, identifier);
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, identifier);
}
}
}