Question by
Gatau · Apr 09, 2017 at 04:27 PM ·
editorwindownamespace
In EditorWindow: The type or namespace 'MyClass' could not be found
I am trying to refactor my code from the EditorWindow calss to a couple of scripts and I then encounter this problem:
The type or namespace name 'MyClass' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp-Editor]
Structure:
Assets
AssetName
Editor
MyAsset.cs
Scripts
MyClass.cs
MyAsset.cs:
namespace MyAssetNamespace
{
public class MyAsset : EditorWindow
{
private List<MyClass> MyClassList = new List<MyClass>();
// excluded the rest of the code here
}
}
MyClass.cs:
namespace MyAssetNamespace
{
public class MyClass : MonoBehaviour
{
public int SomeNumber { get; set; }
}
}
The error occurs in MyAsset.cs
on private List<MyClass> MyClassList = new List<MyClass>();
where I am unable to use MyClass
even when they are within the same namespace.
I am using Unity 5.5.0f3, is there something about EditorWindow
that prevents this from working?
Comment