public void ReceiveButtonOnClick() { if (GameSystem.GetInstance().IsGiftAvailableNow) { coin = GameSystem.GetInstance().ReceiveGift(); if (GameSystem.GetInstance().IsVIP) { coin /= 2; } int endIndex = -1; int index = 0; foreach (GiftItem giftItem in giftItems) { if (giftItem.Number == coin && RandomTool.Int(2) == 1) { endIndex = index; break; } index++; } if (endIndex == -1) { index = 0; foreach (GiftItem giftItem in giftItems) { if (giftItem.Number == coin) { endIndex = index; break; } index++; } } timer = 0; currentTimes = 0; jumpTimes = 90; startIndex = endIndex - jumpTimes % giftItems.Length; UpdateJumpInterval(); if (startIndex < 0) { startIndex += giftItems.Length; } giftItemSelector.SetActive(true); startAnim = true; } }