void Start() { gameObject.GetComponent <Button>().onClick.AddListener(() => { buttonclick(); }); init = GameObject.FindGameObjectWithTag("initializer").GetComponent <script_Initializer>(); buyb = GameObject.FindGameObjectWithTag("buybutton").GetComponent <buybutton>(); text_brand = transform.GetChild(0).GetComponent <Text>(); text_flavor = transform.GetChild(1).GetComponent <Text>(); text_qty = transform.GetChild(2).GetComponent <Text>(); text_price = transform.GetChild(3).GetComponent <Text>(); text_brand.text = brand; text_flavor.text = flavor; text_qty.text = qty.ToString(); text_price.text = "§" + price.ToString(); transform.SetParent(GameObject.FindGameObjectWithTag("buyparent").transform); transform.localScale = Vector3.one; if (index > 3 && itemamount > 4) { transform.localPosition = new Vector3(960 / (itemamount - 3) * (index - 3) - 480, -90, 0); } else if (index <= 3 && itemamount > 4) { transform.localPosition = new Vector3(960 / (4 + 1) * (index + 1) - 480, 20, 0); } else { transform.localPosition = new Vector3(960 / (itemamount + 1) * (index + 1) - 480, 0, 0); } buyb.index = -1; }
void Awake() { init = GameObject.FindGameObjectWithTag("initializer").GetComponent <script_Initializer>(); fileloc_inv = init.fileloc_inventory; fileloc_trans = init.fileloc_transacts; loadteas(); }
void Start() { elderhandler = gameObject.GetComponentInParent <elderhandler>(); init = GameObject.FindGameObjectWithTag("initializer").GetComponent <script_Initializer>(); button = gameObject.GetComponent <Button>(); image = button.GetComponent <Image>(); gameObject.GetComponent <Button>().onClick.AddListener(() => { prebuttonclick(); }); }
void Awake() { init = GameObject.FindGameObjectWithTag("initializer").GetComponent <script_Initializer>(); fileloc_trans = init.fileloc_transacts; if (name == "recent1" || name == "recent2" || name == "recent3") { gethistory(); } }
void Start() { init = GameObject.FindGameObjectWithTag("initializer").GetComponent <script_Initializer>(); fileloc_donations = init.fileloc_donations; gameObject.GetComponent <Button>().onClick.AddListener(() => { buttonclick(); }); elderhandler = gameObject.GetComponentInParent <elderhandler>(); brandfield = GameObject.Find("InputField_brand").GetComponent <InputField>(); flavorfield = GameObject.Find("InputField_flavor").GetComponent <InputField>(); qtyfield = GameObject.Find("InputField_qty").GetComponent <InputField>(); costfield = GameObject.Find("InputField_cost").GetComponent <InputField>(); }