internal void OnSetFirstPosition() { Vector3 POS = ScrollPanel.GetComponent <RectTransform> ().localPosition; POS.x = MainPanel.GetComponent <RectTransform> ().rect.width / 2; ScrollPanel.GetComponent <RectTransform> ().localPosition = POS; }
void Start() { // JSONObject data = new JSONObject (); // data.AddField ("2", "5"); // data.AddField ("3", "1"); // data.AddField ("4", "2"); // JSONObject jdata = new JSONObject (); // jdata.AddField ("data", data); // OnInventoryListResponse (jdata); float GridSize = (MainPanel.GetComponent <RectTransform> ().rect.height / 2) - 10; ScrollPanel.GetComponent <GridLayoutGroup> ().cellSize = new Vector2(GridSize, GridSize); }
void Start() { float GridSize = (MainPanel.GetComponent <RectTransform> ().rect.height) - 5; ScrollPanel.GetComponent <GridLayoutGroup> ().cellSize = new Vector2(GridSize, GridSize); }