Exemplo n.º 1
0
    protected void ChangeParent(Transform newParent, Transform child, bool bKeepingLocalTransform, Transform addTransform)
    {
        NcTransformTool ncTransformTool = null;

        if (bKeepingLocalTransform)
        {
            ncTransformTool = new NcTransformTool(child.get_transform());
            if (addTransform != null)
            {
                ncTransformTool.AddTransform(addTransform);
            }
        }
        child.set_parent(newParent);
        if (bKeepingLocalTransform)
        {
            ncTransformTool.CopyToLocalTransform(child.get_transform());
        }
        if (bKeepingLocalTransform)
        {
            NcBillboard[] componentsInChildren = base.get_gameObject().GetComponentsInChildren <NcBillboard>();
            NcBillboard[] array = componentsInChildren;
            for (int i = 0; i < array.Length; i++)
            {
                NcBillboard ncBillboard = array[i];
                ncBillboard.UpdateBillboard();
            }
        }
    }