Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Set depth on Graphic

Discussion in 'UGUI & TextMesh Pro' started by JeremyDB, Sep 2, 2014.

  1. JeremyDB

    JeremyDB

    Joined:
    May 29, 2014
    Posts:
    12
    I'm trying to migrate from NGUI to 4.6 and noticed that the API only has "get" support on the Graphic.Depth. Is there a way to set it, or am I looking at manipulating depth in the wrong way?

    In general, I'm trying to add new objects in a way that procedurally controls their draw order.
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Done through the hierarchy sort order. GameObjects on top are drawn under (first) objects below. See transform.SetSiblingIndex().
     
  3. JeremyDB

    JeremyDB

    Joined:
    May 29, 2014
    Posts:
    12
    Ah .. thanks! I'll take a look at that --