LoginSignup
2
0

More than 3 years have passed since last update.

【Unity】ExecuteInEditModeは将来廃止、ExecuteAlwaysへ置き換えていく必要あり

Last updated at Posted at 2020-12-22

とあるソースコードを読んでいて、見慣れないアトリビュートを見かけました。

[ExecuteAlways]

調べてみると、ExecuteInEditModeの代わりとなるアトリビュートでした。

ExecuteInEditModeがPrefabModeが実装されるUnity2018.2以前のものだったため、PrefabModeを考慮する上で新しいアトリビュートが必要になったとのこと。

This attribute is being phased out since it does not take Prefab Mode into account. If a Prefab with a MonoBehaviour with this attribute on is edited in Prefab Mode, and Play Mode is entered, the Editor will exit Prefab Mode to prevent accidental modifications to the Prefab caused by logic intended for Play Mode only.

Unity - Scripting API: ExecuteInEditModeより

公式マニュアルの通りExecuteInEditModeは廃止されていきます。
早めの置き換えを。

最後に

2020年も残りわずか。
今年もアドベントカレンダー書きました。

【Unity】新規ゲームのUI開発で気をつけた39のTips前編 - Qiita
【Unity】新規ゲームのUI開発で気をつけた39のTips後編 - Qiita

では、良いお年を。

参考

2
0
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
2
0