protected void Increment(GameObject Obj) { if (Obj == null) { error = true; return; } CardBehaviour card = Obj.GetComponent <CardBehaviour> (); int num = card.CardNumberForInt() + 1; card.SetVariable(num); ApplyChangeVariable(num, card.cardString); }
protected void FindMinimumIndex(GameObject Obj) { if (Obj == null) { return; } int num = Obj.GetComponent <CardBehaviour>().CardNumberForInt(); int minimamNum = 999; int minimam = -1; for (int i = num; i < ElementsList.Count; i++) { CardBehaviour cardBhv = ElementsList[i].GetComponent <CardBehaviour>(); if (cardBhv.CardNumberForInt() < minimamNum) { minimamNum = cardBhv.CardNumberForInt(); minimam = i; } } ThrowUpElement(Obj, minimam.ToString()); }
protected void Print() { // Load Fukidashi <(___________) if (fukudashi == null) { fukudashi = Instantiate(Resources.Load("Prefab/Fukidashi"), this.transform.position + Vector3.up * 3F, Quaternion.identity) as GameObject; fukudashi.GetComponent <RectTransform>().SetParent(GameObject.Find("Buttons").GetComponent <RectTransform>()); } Text fukidashiText = fukudashi.transform.FindChild("Text").GetComponent <Text> (); if (ElementsList [0].name == "NewLine") { fukidashiText.text = fukidashiText.text + "\n"; } else { CardBehaviour card = ElementsList[0].GetComponent <CardBehaviour>(); if (card != null) { if (card.putInside) { fukidashiText.text = fukidashiText.text + card.CardNumberForInt(); } else { fukidashiText.text = fukidashiText.text + ElementsList [0].name; } } else { fukidashiText.text = fukidashiText.text + ElementsList [0].name; } } }
void AddCardElementsList(GameObject obj) { string str; CardBehaviour cardBhav = obj.GetComponent <CardBehaviour> (); if (cardBhav == null) { // Add objectname to ElementsList str = obj.name; } else { // This is a card. if (cardBhav.putInside) // It is variavle, and visible a assignning value. { str = cardBhav.CardNumberForInt().ToString(); } else // It is variavle, and invisiable a assignning value. { str = obj.name; } } ElementsList.Add(str); }