- Home /
The question is answered, right answer was accepted
C# Array doesn't appear on Inspector
I have recently converted from JS to C#. I've been converting my scripts and everything is working except for arrays that don't appear on the unity inspector menu. I need them to appear there because I have to change some values manually without modifying the code.
This is one of my arrays (All of them are similar to this one):
public class Currency
{
public string Name;
public int Amount;
public Texture Icon;
}
public Currency[] Riches;
I have searched in the unity forums and answers about a solution but didn't get one.
Thanks for your help, SoumiDelRio
Answer by fafase · Nov 17, 2013 at 12:31 PM
I guess you mean the members are not showing. Add the attribute:
[System.Serializable]
public class Currency
{
public string Name;
public int Amount;
public Texture Icon;
}
Follow this Question
Related Questions
Can a GameObject inside of an array be made "accessible" from the editor? 2 Answers
Prefab not loading in data from Inspector 1 Answer
Multiple Cars not working 1 Answer
How do I assign 3 variables to every GameObject in the array "enemy"? 2 Answers
Insert new custom class element with _default_ values to a SerializedProperty array? 1 Answer