Unity3D/Trouble Shooting

CS0234: The type or namespace name `MovieTexture' does not exist in the namespace `UnityEngine'.

blueasa 2016. 11. 24. 12:11

Assets/UCSS/Scripts/Protocols/HTTPProtocol.cs(20,63): error CS0234: The type or namespace name `MovieTexture' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?


유니티에 WWW wrapper 에셋(http://u3d.as/8e6)을 추가하고 안드로이드로 빌드하려고 시도하니 위와 같은 에러가 나서 뭐지 했는데


찾아보니 아래와 같은 글이 있다.

MovieTexture는 모바일에서 더이상 지원을 하지 않는다고 한다.(PC빌드 전용인가?)


as of 2015/10/6, MovieTextures are still not supported on Android and iOs


First, any code using "MovieTexture" MUST be set only for PC builds. The game I am working on is for Android and PC, so I use the following preprocessor commands:

  1. #if UNITY_ANDROID
  2. Handheld.PlayFullScreenMovie("");
  3. #else
  4. MovieTexture stuff;
  5. #endif


그래서 해당 에셋의 MovieTexture 부분에 iOS/AOS에서 안돌아가게 아래와 같이 define을 추가했다.


#if UNITY_PRO_LICENSE && !UNITY_WEBGL && !UNITY_IOS && !UNITY_ANDROID

        public EventHandlerMovieTexture     movieTextureCallback;

#endif


#if UNITY_PRO_LICENSE && !UNITY_IOS && !UNITY_ANDROID

    void GetMovie()

    {

// 중략..

    }

#endif




[참조] https://forum.unity3d.com/threads/movietexture-has-no-definition-for-iphone-android.73338/

[참조] http://answers.unity3d.com/questions/377854/why-cannot-build-movie-texture-on-android.html


반응형