- Home /
using UnityEditorInternal name space on Mobile
I got an Error ...
error CS0246: The type or namespace name `UnityEditorInternal' could not be found. Are you missing a using directive or an assembly reference?
I added "using UnityEditorInternal;" already but error happend. can't we namespace of 'using UnityEditorInternal' on mobile ?
Answer by Clet_ · May 19, 2014 at 04:48 AM
The namespaces UnityEditor or UnityEditorInternal are not included when you build for a platform. Those are only included when working in the actual UnityEditor.
For whatever reasons you needed those namespace at runtime, you'll have to find a workaround, because that can't be done
Thank you! This helped me. As a work around I wrapped my class in a conditional compilation statement like so: #if UNITY_EDITOR using UnityEditor; [CustomEditor(typeof(EntityPool))] [CanEdit$$anonymous$$ultipleObjects] public class EntityPoolEditor : Editor { } #endif
[Platform dependent compilation][1] [1]: https://docs.unity3d.com/$$anonymous$$anual/PlatformDependentCompilation.html
That doesn't seem to make much sense. Custom editors should be located in an "editor" subfolder. Things in an editor folder are only compiled in the editor and not included in a build.
In my case this happened because i have created a UP$$anonymous$$ custom package which im sharing across games. Inside my unity package i created an editor folder with the scripts that edit some of my custom components. I then imported the package by adding it to the package manager through add "package through a git URL" button which imports the package without issue. But then when i tried to build the game for android it gave the error that the UnityEditor script wasn't found. Are you missing a using directive or an assembly reference? @Bunny83 Is that make sense?
The workaround in my case was simple: the 3rd party plugins/tools were using "Editor" folder for interface. I simply created another Assembly Definition within "Editor" folder with only "Editor" selected for "Included Platforms". I hope it will help someone.
Your answer
Follow this Question
Related Questions
Mecanim How Animate Bone a Ball Using Humanoid? 0 Answers
Is there a way to use physics to keep a character from clipping through itself during an animation? 0 Answers
Mecanim Anim screwing up character 2 Answers
Dynamically attaching a skinnedMeshRenderer to existing character 0 Answers
Animation must be marked as Legacy, however there is no way to do so. 1 Answer