// This function will be used to wait 3 seconds before the spinning stops IEnumerator Example() { yield return(new WaitForSeconds(3)); One.GetComponent <slotReel> ().setSpin(false); Two.GetComponent <slotReel> ().setSpin(false); Three.GetComponent <slotReel> ().setSpin(false); }
// This function ask the other three reels to spin public void spin() { string x, y, z; One.GetComponent <slotReel> ().setSpin(true); Two.GetComponent <slotReel> ().setSpin(true); Three.GetComponent <slotReel> ().setSpin(true); StartCoroutine(Example()); }
// Start is called before the first frame update void Start() { if (cursorSpeed == 1) { One.GetComponent <LeanToggle>().On = true; } else if (cursorSpeed == 2) { Two.GetComponent <LeanToggle>().On = true; } else { Three.GetComponent <LeanToggle>().On = true; } if (hitboxBool) { hitbox.GetComponent <LeanToggle>().On = true; } else { hitbox.GetComponent <LeanToggle>().On = false; } if (particles) { particleUI.GetComponent <LeanToggle>().On = true; } else { particleUI.GetComponent <LeanToggle>().On = false; } if (music) { musicUI.GetComponent <LeanToggle>().On = true; } else { musicUI.GetComponent <LeanToggle>().On = false; } One = GameObject.Find("Radio 1 (LeanToggle + LeanButton)"); Two = GameObject.Find("Radio 2 (LeanToggle + LeanButton)"); Three = GameObject.Find("Radio 3 (LeanToggle + LeanButton)"); }
// Use this for initialization void Start() { string[] seperators = { " " }; // Instantiate a prefab for each of the objects One = Instantiate(Resources.Load("PreFabs/singleReel", typeof(GameObject))) as GameObject; Two = Instantiate(Resources.Load("PreFabs/singleReel", typeof(GameObject))) as GameObject; Three = Instantiate(Resources.Load("PreFabs/singleReel", typeof(GameObject))) as GameObject; // Intialize the names of each of the reel to relate back to them later One.GetComponent <slotReel>().setName("reel1"); Two.GetComponent <slotReel> ().setName("reel2"); Three.GetComponent <slotReel> ().setName("reel3"); // Add the list of rating payouts to the list payAmount.Add(new winnings("R7", "R7", "R7", 100)); payAmount.Add(new winnings("3B", "3B", "3B", 60)); payAmount.Add(new winnings("2B", "2B", "2B", 40)); payAmount.Add(new winnings("1B", "1B", "1B", 20)); payAmount.Add(new winnings("AB", "AB", "AB", 10)); payAmount.Add(new winnings("OR", "OR", "OR", 5)); payAmount.Add(new winnings("PL", "PL", "PL", 4)); payAmount.Add(new winnings("CH", "CH", "CH", 3)); }
public int payout() { int cash = 0; for (int j = 0; j < payAmount.Count; j++) { int tmp = 0; tmp = payAmount [j].checkCharacters(One.GetComponent <slotReel> ().getResults() , Two.GetComponent <slotReel> ().getResults(), Three.GetComponent <slotReel> ().getResults()); if (tmp > cash) { cash = tmp; } } return(cash); }