Version: 2018.2
public static bool isEditor ;

説明

エディター上でプレイしているかを確認します(読み取り専用)

ゲームが Unity エディターで実行されている場合は true を返します。ターゲットにデプロイして実行した場合は false を返します。

using UnityEngine;

class Example : MonoBehaviour { void Start() { if (Application.isEditor) { print("We are running this from inside of the editor!"); } } }