Hi, I’m trying to check a panel is LastSibling or not. How can I do that with C#?
Please help.
Thanks in advanced.
Here’s a C# extension method that checks if a transform is the last sibling or not:
public static bool IsLastSibling(this Transform t)
{
if(t != null && t.parent != null)
{
return t.GetSiblingIndex() == (t.parent.childCount - 1);
}
return true;
}