Unity3d error CS0246: The type or namespace name `UnityEditor' could not be found

ExportAssetBundles.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
Error building Player because scripts had compiler errors

 전에 작업을 어느정도 마무리 지었던 에셋번들 패치 시스템을 정식으로 게임에 적용하는 데 있어서 위와같은 빌드 에러가 발생했습니다.

using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;

public class ExportAssetBundles {
//...
#endif
 using UnityEditor을 사용하는 컴포넌트가 있다면 그 위에서 전처리기로 막아서 사용하시거나

 해당 스크립트를 Editor 디렉터리를 만들어 그곳에 넣으면 소스 수정없이 유니티툴에서만 사용하게 할 수 있습니다.

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.