private void OnItemClick() { detailWin.SetActive(true); CommonTool.GuiScale(detailWin, GuiController.Instance.CurCanvasGroup, true); Dictionary <string, GameObject> detailWinDict = CommonTool.InitGameObjectDict(detailWin); CommonTool.InitText(detailWin); CommonTool.InitImage(detailWin); Text chapterDetailPattern_Time = detailWinDict["ChapterDetailPattern_Time"].GetComponent <Text>(); Text chapterDetailPattern_Number = detailWinDict["ChapterDetailPattern_Number"].GetComponent <Text>(); Text chapterDetailTime = detailWinDict["ChapterDetailTime"].GetComponent <Text>(); Text chapterDetailNumber = detailWinDict["ChapterDetailNumber"].GetComponent <Text>(); Text chapterDetailSymbol = detailWinDict["ChapterDetailSymbol"].GetComponent <Text>(); Text chapterDetailDigit = detailWinDict["ChapterDetailDigit"].GetComponent <Text>(); Text chapterDetailOperand = detailWinDict["ChapterDetailOperand"].GetComponent <Text>(); Text chapterDetailOneStarCondition = detailWinDict["ChapterDetailOneStarCondition"].GetComponent <Text>(); Text chapterDetailTwoStarCondition = detailWinDict["ChapterDetailTwoStarCondition"].GetComponent <Text>(); Text chapterDetailThreeStarCondition = detailWinDict["ChapterDetailThreeStarCondition"].GetComponent <Text>(); GameObject chapter2FightFrameBtn = detailWinDict["Chapter2FightFrameBtn"]; bool isTimePattern = content.cInstance.patternID == PatternID.Time; chapterDetailPattern_Time.gameObject.SetActive(isTimePattern); chapterDetailPattern_Number.gameObject.SetActive(!isTimePattern); chapterDetailTime.gameObject.SetActive(isTimePattern); chapterDetailNumber.gameObject.SetActive(!isTimePattern); if (isTimePattern) { int amount = FightController.Instance.GetTimeAmount(content.cInstance.amountID); chapterDetailTime.text = string.Format(chapterDetailTime.text, amount); } else { int amount = FightController.Instance.GetNumberAmount(content.cInstance.amountID); chapterDetailNumber.text = string.Format(chapterDetailNumber.text, amount); } string symbol = FightController.Instance.GetSymbol(content.cInstance.symbolID); chapterDetailSymbol.text = string.Format(chapterDetailSymbol.text, symbol); chapterDetailDigit.text = string.Format(chapterDetailDigit.text, (int)(content.cInstance.digitID + 2)); chapterDetailOperand.text = string.Format(chapterDetailOperand.text, (int)(content.cInstance.operandID + 2)); InitCondition(chapterDetailOneStarCondition, 1); InitCondition(chapterDetailTwoStarCondition, 2); InitCondition(chapterDetailThreeStarCondition, 3); CommonTool.AddEventTriggerListener(chapter2FightFrameBtn, EventTriggerType.PointerClick, OnFightClick); }
public void OnPointerClick(PointerEventData eventData) { if (detailWin) { detailWin.SetActive(true); Dictionary <string, GameObject> detailWinDict = CommonTool.InitGameObjectDict(detailWin); bluetoothConnectWaiting = detailWinDict["BluetoothConnectWaiting"]; GameObject connectConfirmBtn = detailWinDict["ConnectConfirmBtn"]; bluetoothConnectTime = detailWinDict["BluetoothConnectTime"].GetComponent <Text>(); Text bluetoothPeripheralDetailTitle_Text = detailWinDict["BluetoothPeripheralDetailTitle_Text"].GetComponent <Text>(); bluetoothConnectWaiting.SetActive(false); string tip = LanguageController.Instance.GetLanguage(bluetoothPeripheralDetailTitle_Text.index); bluetoothPeripheralDetailTitle_Text.text = string.Format(tip, content.name); CommonTool.AddEventTriggerListener(connectConfirmBtn, EventTriggerType.PointerClick, ConnectToPeripheral); } }