Search Unity

Meshes no longer rendering after Unity upgrade

Discussion in 'UGUI & TextMesh Pro' started by etoreo, Mar 4, 2015.

  1. etoreo

    etoreo

    Joined:
    Apr 11, 2012
    Posts:
    104
    I upgraded to Unity 4.6.3 and now none of my custom meshes on Canvas renders are drawing... Any ideas as to why?
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Hmm, could be something as simple as a regression issue.
    Have you tried the latest patch release? If it still doesn't work, I'd log it with a sample project
     
  3. etoreo

    etoreo

    Joined:
    Apr 11, 2012
    Posts:
    104
    I am using the latest and greatest: 4.6.3f1

    I have tracked it down to this code I have for sorting by z-value... I expect it has something to do with removing and re-adding the child objects instead of assigning the new position.

    public static void SortChildren(GameObject pParentGo)
    {
    // Sort the children by z value
    List<Transform> children = new List<Transform>();
    for (int i = pParentGo.transform.childCount - 1; i >= 0; i--)
    {
    Transform child = pParentGo.transform.GetChild (i);
    children.Add (child);
    child.SetParent(null);
    }
    children.Sort((Transform t1, Transform t2) => { return t2.transform.position.z.CompareTo(t1.transform.position.z); });
    foreach (Transform child in children)
    {
    child.SetParent(pParentGo.transform);
    }
    }
     
  4. etoreo

    etoreo

    Joined:
    Apr 11, 2012
    Posts:
    104
    Yes, removing:

    child.SetParent(null)
    child.SetParent(pParentGo.transform)​

    and replacing them with

    child.SetSibilingIndex(i)​

    cleared this right up.