Okay, I have a GameObject Array as an inventory (C#), and I want to reorder the items inside the array to put the null values of the array at the end, for example:
inventory[0] = null;
inventory[1] = "Sword";
inventory[2] = "Armor";
inventory[3] = null;
inventory[4] = "Key";
inventory[5] = null;
and I want to reorder to:
inventory[0] = "Sword";
inventory[1] = "Armor";
inventory[2] = "Key";
inventory[3] = null;
inventory[4] = null;
inventory[5] = null;
The array’s lenght is always 6, and I don’t need it to be sorted alphabetically, I only need the nulls at the end, how do I do it? Thanks.