0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Unity スクリプトの実行順序制御 メモ

Posted at

■属性による制御
 Start等の実行順序を制御できないので、
 クラスにDefaultExecutionOrder属性 を付けて制御する。

 ()の中の数字が小さいほうが優先して実行される、使いすぎると制御しきれなくなりそう

[DefaultExecutionOrder(-1)]
public class XXXX : MonoBehaviour
{
}

 ●参考URL
 https://www.hanachiru-blog.com/entry/2019/04/30/213102

■Project設定による制御

 Project Settings ---> Script Execution Order で設定する。
 ダイアログの上から下の順序でスクリプトは実行され、Default Time 上下に置くことで制御する。

 ●参考URL
 https://docs.unity3d.com/ja/2018.4/Manual/class-MonoManager.html
 https://qiita.com/hibiki8229/items/335978e65273a87e8d69

■Default Timeって何??

 公式リファレンスに定義がなかったので、どのタイミングを指すのかは不明
 Start??・Awake??・そういうのとは違う概念??

 下記の方がいろいろ調査していた。

 ●参考URL
 https://qiita.com/ogawa-to/items/f8c26193cacfa3d2d666

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?