#Weird errors after using namespace
1 messages · Page 1 of 1 (latest)
Show code
Interesting
Quick sidenote: Why is your behaviour marked Serializable?
That's redundant, MonoBehaviour is serializable anyway
Oh well, my bad then
Does the error point to a specific line?
the only time I see the type being used is line 296
actionBaseList.Insert(queuePosition, new CutsceneCollider.SFXAction());
is there anywhere else it's being referenced?
This one
EditorGUILayout.LabelField("Action: " + queueSpot + " - Type: " + cutsceneAction.actionType.ToString(), EditorStyles.largeLabel);
Line 311
That's the Nullreference exception
that's...
odd
cutsceneAction must be null, but I can't see where, because at no point do you add a null to the list
Yeup, I am pretty confused especially because the namespace is what breaks it
It's thoroughly tested and it works perfectly otherwise
I haven't tried that yet...
like
rebuilt project by deleting csproj and sln I mean
so Unity regenerates everything
Damn wth
Oh wait
Do you have all this code in one file?
Ahh yes I see, you have the editor stuff nested inside the class
That can be an issue
Editor stuff should be in an Editor folder
and ideally, every class should be in its own file
They are in their own files, I just compiled them together real quick here so I can send them in one .txt :(
CutsceneColliderEditor is also in Assets/Editor folder
But you have this
#region Editor
#if UNITY_EDITOR
[CustomEditor(typeof(CutsceneCollider))]
public class CutsceneColliderEditor : Editor
{
private int cutsceneEventIndex = 0;
int queuePosition = 0;
nested inside the class 🤔
Yep, I nested them so I can send them as one .txt to test if that would work. But the same problem persists even if they are separate files
Tried both methods
Same xD
Thankfully, it works without the namespace. I guess I'll just keep it this way until maybe there's a fix someone comes up with
I guess that works, just really inconvenient though because namespaces help with organisation
but I truly can't think why this problem is happening
I hope you get it resolved soon tho
Do you use *.asmdef file?
nope, dont even know what that is
Thanks!
Similar issue happend to me in two moments:
- I changed class name and forgot file name
- I do not include in asmdef reference to another definition file
Do you have others editor script?
you can have editor stuff in a regular script as long as it has the #if UNITY_EDITOR preprocessor directive
Nope, no class names were changed. And yes, I have other editor scripts that do not give me issues like this
And I still don't know what asmdef is 
😆 ...lets say it's like bigger namespace, you can organize scripts and namespaces into libraries.
Okay, so your all editor scripts are under Asset/Editor?
Or you have them nested with #if Unity_Editor?
And referenced namespace is inside Asset folder too ?
Yes, I reference the namespace. Yes, They are in Asset/Editor
You wrote this namespace or is it coming from some package?
we need an emote for that
I wrote it, yeah
Huh.. so its tough

