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;
|
|
}
|
|
}
|