void Update() { if (cellSpinState == SLOT_STATE_SPIN) { for (int i = 0; i < cells.Length; i++) { SlotCell cell = cells [i]; if (cell.isSpin == false) { cells [i].StartSpin(); } } } else if (cellSpinState == SLOT_STATE_STOP) { cellSpinState = SLOT_STATE_IDLE; if (cells [0].isSpin == true) { StartCoroutine( StopLines(() => { HighlightSlotResults(GetSlotResults()); })); } } }
IEnumerator StopLines(System.Action callback) { for (int i = 0; i < cells.Length; i++) { SlotCell cell = cells [i]; if (cell.isSpin == true) { cell.StopSpin(); yield return(new WaitForSeconds(LINE_STOP_INTERVAL)); } } yield return(new WaitForSeconds(LINE_STOP_INTERVAL + SlotCell.STOP_IMPEDENCE_DELAY_TIME)); callback(); }