Ok i know that question has been asked many times but im searching the internet and Unity answers/forums for hours and couldn’t find a single solution.(Or i am frustrated and couldn’t see what was in front of my eyes,i’m not sure:) )
I’m trying to create an Editor script which will read a sheet and assign it into and array inside the gameObject which is the script is attached.Everything is perfect until here.
But im having trouble assigning that array to the actual script.
I have tried following :
_script = (TextureAtlasReader)target;
//FYI : method below returns a Vector2[][]
_script.frames = CacheAnimation();
EditorUtility.SetDirty(target);
serializedObject.ApplyModifiedProperties();
and this (i was very hopeless and gave it a try :D)
Vector2[][] tempArray = CacheAnimation();
for (int i = 0; i < frames.arraySize; i++)
{
for (int j = 0; j < frames.GetArrayElementAtIndex(i).arraySize; j++)
{
frames.GetArrayElementAtIndex(i).vector2Value = tempArray*[j];*
}
}
Any help would be great.
Summary
class X has a Vector2[][] array.
XEditor custom editor have to modify/create this array.