Cannot Set Array Size in Inspector
Just as the name implies, I cannot set any array size in the inspector. I first noticed this happen in a project for the Unity Asset Store I was working on. I thought it was my custom class causing problems, but even simple classes and data types aren't working.
This is my test code: public class ArrayTest : MonoBehaviour { public int[] MyIntArray; } It's a simple script I made to try and remove any interaction with other scripts. Testing in an empty project (except for this one script). Tried resetting script. Tried re importing assets.
Running in Unity 5.0 and in Unity 5.1 Arrays worked for both versions previously.
Please help, Thanks
Sorry code got messed up, should read:
public class ArrayTest : $$anonymous$$onoBehaviour {
public int[] $$anonymous$$yIntArray;
}
Does your script have a custom editor, or is this just the default inspector?
$$anonymous$$y original script that I noticed the problem on had a custom inspector, but everything else, including my basic test script is using default inspector. Also the problem is affected all 3 projects I've tried across 2 Unity versions.
It sounds like a bug. If you can't reproduce it in a more recent version of Unity (I can't locally) then I'd suggest at least checking to see if some patch release in your cycle fixed it, if you can't just upgrade to something altogether more recent (e.g., 5.3+). Unfortunately 5.0 and 5.1 are not likely to see any bug fixes any time soon.
Answer by zeman97 · Jan 21, 2017 at 02:15 AM
OH MY GOD I FIXED IT I'M SO EMBARRASSED
The issue was that my numlock had been turned off (I use numpad for inputing numbers exclusively). I tried with the normal number keys and then turned num lock back on and it all works.
Huge thanks to everyone who tried to help out, can't believe it was something so simple XD
Answer by AurimasBlazulionis · Jan 20, 2017 at 10:34 PM
Project settings might have messed up. Create a new project and transfer all the assets there. See if there is the same problem. Maybe you have an editor script which handles all components?
I created a new project and tried my test code (one simple array) and it still does not work.
I don't have any editor scripts that handle all components and in the empty project the only code present is the test code I provided.
Your answer
Follow this Question
Related Questions
How to save a two-dimensional array, as part of the variable inspector? 0 Answers
Custom Inspector changes not updating target in Edit Mode 1 Answer
Custom Editor List with child classes 1 Answer
[Editor]Get FieldInfo by using an instance of that field 1 Answer
Is there a way to live-update script-controlled UI formatting in the editor? 0 Answers