02-06-2020, 10:21 PM
Hi,
While reading again your post, I noticed the "Line 42 is the first in the loop." that I missed when I first read it. So the line being
orgPos[index] = checkController.AbsolutePosition;
means that either orgPos is null, or checkController is null. Since checkController comes from selectedItems which does not contain null items, the reasonable conclusion would be that orgPos is null. The easy way to confirm this is to Log orgPos and checkController before using them line 42.
I feel that by going down the [CustomEditor(typeof(SplineController))] road, you are hunting the consequence and not the cause of your issue. Stay focused on the null reference. If there is a null referencing and you check and don't fin anything wrong, that means that you haven't checked good enough. With the logs I suggested earlier you will definitely find which variable is null
While reading again your post, I noticed the "Line 42 is the first in the loop." that I missed when I first read it. So the line being
orgPos[index] = checkController.AbsolutePosition;
means that either orgPos is null, or checkController is null. Since checkController comes from selectedItems which does not contain null items, the reasonable conclusion would be that orgPos is null. The easy way to confirm this is to Log orgPos and checkController before using them line 42.
I feel that by going down the [CustomEditor(typeof(SplineController))] road, you are hunting the consequence and not the cause of your issue. Stay focused on the null reference. If there is a null referencing and you check and don't fin anything wrong, that means that you haven't checked good enough. With the logs I suggested earlier you will definitely find which variable is null
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.