You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
497 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class TransformUtility
{
public static float GetGlobalIndex(this Transform transform)
{
float retVal = transform.GetSiblingIndex() + 1;
transform = transform.parent;
while (transform != null)
{
retVal /= 10;
retVal += transform.GetSiblingIndex() + 1;
transform = transform.parent;
}
return retVal;
}
}