// if Color match queue color, add one point, and create another color into queue. public bool match(GeneralTable.Type typeValue) { currentColorBallNum++; bool result = false; if (!typeValue.Equals(targetTypeQueue.Peek())) { failFlag = true; result = true; } if (currentColorBallNum == estimateColorBallNum) { GamePlayManager.Instance.ResetTimer(); if (failFlag) { PerformFail(); } else { currentPoint++; GamePlayManager.Instance.NextStage(); GeneralTable.Type currentType = targetTypeQueue.Peek(); while (currentType == targetTypeQueue.Peek()) { targetTypeQueue.Dequeue(); targetTypeQueue.Enqueue(GeneralTable.GetRandomType()); } centerPointMeshRenderer.material.color = GeneralTable.GetColor(targetTypeQueue.Peek()); } } return(result); }
public void Reset() { currentPoint = 0; blackFlag = false; cumulativeTime = 0; estimateColorBallNum = 0; currentColorBallNum = 0; failFlag = false; targetTypeQueue.Clear(); for (int i = 0; i < countMax; ++i) { targetTypeQueue.Enqueue(GeneralTable.GetRandomType()); } centerPointMeshRenderer.material.color = GeneralTable.GetColor(targetTypeQueue.Peek()); this.transform.localScale = new Vector3(fixedScale, fixedScale, fixedScale); }