Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Cant change Canvas Parametres

Discussion in 'UGUI & TextMesh Pro' started by LuckyStarr, Mar 13, 2020.

  1. LuckyStarr

    LuckyStarr

    Joined:
    Feb 6, 2018
    Posts:
    9
    Hey everyone) May be comeone can help with this
    Code (CSharp):
    1.  
    2. private void AddCanvasToObject(GameObject gmo) {
    3. gmo.AddComponent<Canvas>();
    4. Canvas _canvas = gmo.GetComponent<Canvas>();
    5. _canvas.overrideSorting = true;
    6. _canvas.sortingLayerName = sordinglayerName;
    7. _canvas.sortingOrder = TutorialManager.TUTORIAL_ORDER;
    8. TutorialManager.TUTORIAL_ORDER++;
    9. }
    Im trying added canvas to some ui element(Image Element) and change canvas parametres(overrife sorting layer and order), Canvas added succesfull, but parametres not changed))) what i deal wrong)
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    611
unityunity