うにてぃブログ

主にUnityとC#に関する記事を書いていきます

Define

【Unity】UnityEditor 上で UNITY_EDITOR の Define が正しいか確認する

大胆な例ですが、これをビルドするともちろんエラーになります using UnityEngine; public class SampleMonoBehaviour : MonoBehaviour { private void Awake() { var editorClass = new EditorClass(); } #if UNITY_EDITOR private class EditorClass { } #…