Ejemplo n.º 1
0
    protected void Init()
    {
        int maxCount = transform.childCount;

        Interval = 1.0f / maxCount;
        for (int i = 0; i < maxCount; i++)
        {
            var         t    = transform.GetChild(i);
            RegGridCell cell = t.gameObject.GetComponent <RegGridCell>();
            if (cell == null)
            {
                cell = t.gameObject.AddComponent <RegGridCell>();
            }
            cell.SetData(Interval * i, this);
        }
    }