概要
using UnityEditor; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var obj = Selection.activeObject; var path = AssetDatabase.GetAssetPath( obj ); var importer = AssetImporter.GetAtPath( path ) as PluginImporter; // Select platforms for plugin の Any Platform を変更する importer.SetCompatibleWithAnyPlatform( false ); // Select platforms for plugin の Include Platforms を変更する importer.SetCompatibleWithEditor( true ); importer.SetCompatibleWithPlatform( BuildTarget.iOS, true ); // Select platforms for plugin の Exclude Platforms を変更する importer.SetExcludeFromAnyPlatform( BuildTarget.iOS, true ); } }
「PluginImporter」を使用すると、
マネージドプラグインやネイティブプラグインの設定をスクリプトから変更できます