private void DoTooltip() { Dialog top = DialogManager.Instance.GetTop(); if (GUI.tooltip.Length > 0 && top != null && top.ID == DialogManager.DIALOG_INDEX.RANDOMBOX) { c_Gachapon gachaponByCode = RandomboxItemManager.Instance.GetGachaponByCode(gachaponCode); TItem tItem = TItemManager.Instance.Get <TItem>(GUI.tooltip); if (gachaponByCode != null && tItem != null) { bool flag = false; int num = 0; while (!flag && num < 5) { if (gachaponByCode.items[num] == tItem.code) { flag = true; tooltip.ItemCode = tItem.code; Vector2 vector = new Vector2((float)(num * 145 + 13), (float)ud_starty); Vector2 vector2 = new Vector2(vector.x + 143f, vector.y); float x = tooltip.size.x; float num2 = tooltip.size.y; if (tItem.type != 0) { num2 -= 130f; } if (num < 4) { tooltip.SetCoord(new Vector2(vector.x, vector.y - num2)); } else { tooltip.SetCoord(new Vector2(vector2.x - x, vector2.y - num2)); } } num++; } if (flag) { GUI.Box(tooltip.ClientRect, string.Empty, "TooltipWindow"); GUI.BeginGroup(tooltip.ClientRect); tooltip.DoDialog(); GUI.EndGroup(); } } } }
private void c_ParseGachapon(CSVLoader csvLoader) { c_Gachapons = new c_Gachapon[csvLoader.Rows]; for (int i = 0; i < csvLoader.Rows; i++) { c_Gachapons[i] = new c_Gachapon(); c_Gachapons[i].items = new string[5]; c_Gachapons[i].qualities = new int[5]; csvLoader.ReadValue(0, i, string.Empty, out string Value); csvLoader.ReadValue(1, i, string.Empty, out string Value2); csvLoader.ReadValue(2, i, string.Empty, out string Value3); csvLoader.ReadValue(3, i, string.Empty, out string Value4); csvLoader.ReadValue(4, i, string.Empty, out string Value5); csvLoader.ReadValue(5, i, string.Empty, out string Value6); Value.Trim(); Value2.Trim(); Value3.Trim(); Value4.Trim(); Value5.Trim(); Value6.Trim(); c_Gachapons[i].code = Value; c_Gachapons[i].itemName = Value2; c_Gachapons[i].classType = String2Type(Value3); c_Gachapons[i].strtblCode = Value4; c_Gachapons[i].icon = FindIcon(Value5); c_Gachapons[i].brickPoint = Convert.ToInt32(Value6); int num = 6; for (int j = 0; j < 5; j++) { csvLoader.ReadValue(num, i, string.Empty, out string Value7); csvLoader.ReadValue(num + 1, i, string.Empty, out string Value8); Value7.Trim(); Value8.Trim(); c_Gachapons[i].items[j] = Value7; c_Gachapons[i].qualities[j] = Convert.ToInt32(Value8); num += 2; } Add(Value, c_Gachapons[i]); } }
private void SetStep(STEP newStep) { step = newStep; deltaTime = 0f; spinDelta = 0f; flickerDelta = 0f; switch (step) { case STEP.READY: break; case STEP.WAIT_RETRY: break; case STEP.SHOW_BACK: { qSlot.Clear(); List <int> list3 = new List <int>(); for (int l = 0; l < 6; l++) { list3.Add(l); } for (int m = 0; m < 6; m++) { int index2 = UnityEngine.Random.Range(0, list3.Count); qSlot.Enqueue(list3[index2]); list3.RemoveAt(index2); } GlobalVars.Instance.PlaySound(sndSlotOn); break; } case STEP.WAIT_INPUT: fadeIn = false; break; case STEP.SPIN: spinIndex = -1; spinning = 0; resultCode = string.Empty; resultRemain = 0; GlobalVars.Instance.PlaySound(sndSlotSpin); break; case STEP.RESULT: resultPhase = 0; GlobalVars.Instance.PlaySound(sndSlotResult); break; case STEP.SHOW_FRONT: { qSlot.Clear(); dicResult.Clear(); c_Gachapon gachaponByCode = RandomboxItemManager.Instance.GetGachaponByCode(gachaponCode); if (gachaponByCode == null) { Debug.LogError("Fail to get gachapon"); } else { List <int> list = new List <int>(); for (int i = 1; i < 6; i++) { if (i != spinIndex) { list.Add(i); } } List <TItem> list2 = new List <TItem>(); for (int j = 0; j < gachaponByCode.items.Length; j++) { if (resultCode != gachaponByCode.items[j]) { TItem item = TItemManager.Instance.Get <TItem>(gachaponByCode.items[j]); list2.Add(item); } } for (int k = 0; k < 4; k++) { int index = UnityEngine.Random.Range(0, list.Count); int num = list[index]; qSlot.Enqueue(num); list.RemoveAt(index); index = UnityEngine.Random.Range(0, list2.Count); dicResult.Add(num, list2[index]); list2.RemoveAt(index); } } break; } } }