LoginSignup
14
7

More than 5 years have passed since last update.

Editor拡張でAssetの設定を変更する場合

Last updated at Posted at 2015-05-26

Editor拡張を利用して新規ファイルを作った時は

AssetDatabase.SaveAssets();
AssetDatabase.Refresh();

こうすればProjectウィンドウに新規作成のファイルが表示されるが既にあるファイルに対して更新を行った場合この方法ではメタファイルに保存してくれなかった。

AssetDatabase.ImportAsset( パス, ImportAssetOptions.ForceUpdate ); 

更新したファイルのインポートを実行してやる必要があるみたい。

リファレンスを見たけどそんなこと書いてなくて苦戦したので忘れないようにメモ

追記

どうやらこれは設定するのもによって変更する様子
この現象に出会った時は
TextureImporter.spritePackingTag
でスプライトのパッキングタグを設定した時にメタファイルが更新されなかったため
ImportAssetを実行した。

けどれ
AssetImporter.assetBundleName
でアセットバンドル名を設定をしたらImportAssetを実行しなくてもメタファイルが更新されていた。

14
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
7