Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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