Search Unity

Serverbrowser Problems, need help

Discussion in 'UGUI & TextMesh Pro' started by GentleForge, Nov 11, 2014.

  1. GentleForge

    GentleForge

    Joined:
    Sep 7, 2013
    Posts:
    29
    Hi there,

    the new GUI System has no sorted list or something like that for an serverbrowser, so i need to write something by my self.

    And, i have problems, to set the local position.

    This is my code:

    Code (CSharp):
    1.          
    2. GameObject temp;
    3. temp = Instantiate(m_row, new Vector3(0, 0, 0), Quaternion.identity) as GameObject; //this is my row
    4. temp.transform.SetParent(m_Panel, false); //parent my row to the content of the scrollbox
    5. temp.GetComponent<ShowServerInfo>().ShowInfo(item); //transfer the server data
    6. temp.GetComponent<RectTransform>().localScale = new Vector3(1, 1, 1); //need to set scale to 1,1,1
    7. temp.GetComponent<RectTransform>().localPosition = new Vector3(0, -20f, 0); //this doesnt work.. idk why
    8.  
    Are there some solutions for my problem?

    //EDIT: Found the soultion: anchoredPosition
     
    Last edited: Nov 11, 2014