void Start() { _body = GetChildCalled("Body_Lbl").GetComponent <Text>(); iniPos = transform.position; Hide(); _workers = new SubBulletinGeneral(this); _production = new SubBulletinProduction(this); _finance = new SubBulletinFinance(this); // _scroll = GetChildCalled("Scroll_View"); _content = GetGrandChildCalledFromThis("Content", _scroll); _contentRectTransform = _content.GetComponent <RectTransform>(); _scroll_Ini_PosGO = GetChildCalledOnThis("Scroll_Ini_Pos", _content); var h = GetChildCalled("Help"); _help = h.GetComponent <Text>(); _help.text = ""; //bz GUI Loades like 4 times PersonData pData = XMLSerie.ReadXMLPerson(); var tempData = Program.gameScene.ProvideMeWithTempData(); //means is reloading from a change in GUI a if (tempData != null) { pData = tempData; } //loading if (pData != null) { SubBulletinProduction1 = pData.PersonControllerSaveLoad.SubBulletinProduction; SubBulletinProduction1.BulletinWindow1 = this; if (pData.PersonControllerSaveLoad.SubBulletinFinance != null) { SubBulletinFinance1 = pData.PersonControllerSaveLoad.SubBulletinFinance; SubBulletinFinance1.BulletinWindow1 = this; } } //means is brand new game if (_finance.FinanceLogger.Budgets.Count == 0) { _finance.FinanceLogger.AddYearBudget(); } }
internal static AcctTile CreateTile(Transform container, DisplayAccount acct, Vector3 iniPos, SubBulletinFinance finance) { AcctTile obj = null; var root = ""; obj = (AcctTile)Resources.Load(Root.acct_Tile, typeof(AcctTile)); obj = (AcctTile)Instantiate(obj, new Vector3(), Quaternion.identity); var iniScale = obj.transform.localScale; obj.transform.SetParent(container); obj.transform.localPosition = iniPos; obj.transform.localScale = iniScale; obj.Acct = acct; obj.Finance = finance; return(obj); }