// Use to process your families. protected override void onProcess(int familiesUpdateCount) { GameObject g = GameObject.FindGameObjectWithTag("PanelOiseau"); if (!started) { instance = this; OiseauPanelBluePrint = _player.First().GetComponent <GameVariables>().prefabPanelOiseau; OiseauPanelBluePrintDetail = _player.First().GetComponent <GameVariables>().prefabPanelOiseauDetail; canvas = GameObject.Find("Canvas"); menu = canvas.GetComponentInChildren <ObjectContainer>(true).menu; panel = canvas.GetComponentInChildren <ObjectContainer>(true).panel; //widthPanel = ((RectTransform)OiseauPanelBluePrint.transform).rect.width; widthPanel = 6; Debug.Log("Width"); Debug.Log(widthPanel); started = true; } if (g) { if (!startedMenu) { initPositionPanel = new Vector3(-(GameObject.FindGameObjectWithTag("PanelOiseau").transform.position.x / 2), -(GameObject.FindGameObjectWithTag("PanelOiseau").transform.position.y / 2), 0); startedMenu = true; } if (nbEspece < _espece.Count) { updateMenu(); } } }
public MenuOiseau() { instance = this; canvas = GameObject.Find("Canvas"); menu = canvas.GetComponentInChildren <PanelScript>(true).gameObject; }