//one line finish. //if called 3times, calculate result. void SlotFinished(int i) { _slot.Add(i); if (_slot.Count == 3) { int prev = -1; foreach (int type in _slot) { if (prev == -1) { prev = type; continue; } if (prev != type) { return; } prev = type; } int gold = (i + 1) * 20 * _bet; PlayerMeta.incraseGold(gold); GameObject[] lights = GameObject.FindGameObjectsWithTag("SlotLight"); for (int _i = 0; _i < lights.Length; _i++) { lights[_i].GetComponent <Animator>().Play("SlotLight"); } } }
// processing Goal in void GoalInBall(int box) { _boxesNum[box - 1]++; if (GameObject.FindGameObjectsWithTag("PinBall").Length <= 1) { PinBall_ResultWIndow window = (PinBall_ResultWIndow)((GameObject)Instantiate(Resources.Load("prefab/PinBall/PinBallResultWindow"))).GetComponent <PinBall_ResultWIndow>(); int give = window.result(_boxesNum); PlayerMeta.incraseGold(give); } }