private void InitTextWindow() { //GameObject go = GameManager.Instance.PopUp.CreateTextWindow("", new Vector2(400,600), Vector2.zero); GameObject go = GameManager.Instance.PopUp.CreateTextWindow("", 30, Vector2.zero); textWindow = go.GetComponent <UI_TextWindow2D>(); textWindow.SetAsTextPriority("", 30); go.SetActive(false); }
/// <summary> /// Create a text window that set his font size on the window size. /// </summary> public GameObject CreateTextWindow(string _str, Vector2 _sizeWindow, Vector2 _pos) { GameObject go = Instantiate(prefabs["textWindow2D"] as GameObject, canvas); UI_TextWindow2D textWindow = go.GetComponent <UI_TextWindow2D>(); textWindow.SetAsWindowPriority(_str, _sizeWindow); go.transform.localPosition = new Vector3(_pos.x, _pos.y, 0); popUpList.Add(go); return(go); }