LoginSignup
6
6

More than 5 years have passed since last update.

【Unity小技】ToDoをエディタ起動時にログ出力させて忘れにくくする

Last updated at Posted at 2015-09-01

[UnityEditor.InitializeOnLoad]をつけるとエディター起動時にstaticコンストラクタが実行されます。これを利用します。

using UnityEngine;
using UnityEditor;
using System.Collections;

[InitializeOnLoad]
public class ToDoWarning
{
    static ToDoWarning()
    {
        if (EditorApplication.timeSinceStartup < 10f)
        {           
            Debug.LogError("TODO ほげほげ.csの行XXXを直す");
        }
    }
}

結果

image

エディター起動時にログ出力してくれました。忘れにくくて便利(かも)

参考リンク

けいごのなんとか - Unityエディタ起動時”のみ”にスクリプト実行

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