Hi there,
I'm having a simple grid and when I remove an element, I'd like to Reposition() so I don't have blanks.
Problem is, when I Reposition dynamically, it doesn't work.
When I do from editor, it does.
So ... I really don't get those function working in editor and not dynamically....
If any of you have a suggestion, I'd love to hear it.
Thanks in advance.
PS: Here's the code executing the delete/reposition.
public void DeleteReply(string index)
{
GameObject temp;
for(int i=0; i < replies.Count; i++)
{
if(replies[i].mReplyObject.name.Contains(index))
{
temp = replies[i].mReplyObject;
replies.RemoveAt(i);
GameState.Instance.mReplies.RemoveAt(i);
GameObject.Destroy(temp);
break;
}
}
mGrid.GetComponent<UIGrid>().repositionNow = true; (1)
mGrid.GetComponent<UIGrid>().Reposition(); (2)
}
I tried with both (1) and (2) alone also.