baobao
2/2/2017 - 4:27 PM

Unity5.6.0b6から PlayerSettings.SetApplicationIdentifierが追加された。

Unity5.6.0b6から PlayerSettings.SetApplicationIdentifierが追加された。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class SetApplicationIdentifierWindow : EditorWindow
{
    [MenuItem("Window/Identifier")]
    static void Open()
    {
        var w = EditorWindow.GetWindow<SetApplicationIdentifierWindow>();
        w.Show();
    }

    void OnGUI()
    {
        if (GUILayout.Button("SET"))
        {
            PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "info.shibuya24.ios");
            PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "info.shibuya24.android");
            // アセット保存
            AssetDatabase.SaveAssets();
        }
    }
}