- Home /
insert more objects at once in a SerializeField,How can i insert more objects at once in a SerializeField
Is it possible to insert more objects at once in a SerializeField from the inspector, if yes how? ,is it posible to insert more objects at once in a SerializeField from inspector , if yes how?
Answer by Kciwsolb · Apr 20, 2018 at 04:09 AM
You can make it apply to more than one of a single type if you declare multiple on the same line separated by commas:
//More than one of the same type on a single line
[SerializeField] int num1, num2, num3;
But you cannot make [SerializeField] apply to more than one statement. So, this is about the best you can do. Note that, like I did above, you can put [SerializeField] on the same line as your declaration. This stops it from taking up an extra line. I think that is most people's problem with it anyways. Hope this helps!
Your answer
Follow this Question
Related Questions
Serializing a System.Action won't work with variables outside of its scope 1 Answer
When OnDeserialized (UnitySerializer) is meant to be called? 1 Answer
What to serialize when app pauses 0 Answers
"Asset Serialization Mode" - Is that only during development or runtime as well? 1 Answer
Serializer Script 3 Answers