private void initAchieveUI() { _achieveInfoLayer = gameObject.transform.Find("AchieveInfoLayer").gameObject.GetComponent <Image>(); _achieveInfoLayerCanvas = _achieveInfoLayer.gameObject.GetComponent <CanvasGroup>(); _achieveInfoLayerCanvas.alpha = 0; _achieveNameText = _achieveInfoLayer.transform.Find("AchieveName").gameObject.GetComponent <Text>(); _achieveFinishTimeText = _achieveInfoLayer.transform.Find("AchieveFinishTime").gameObject.GetComponent <Text>(); _achieveInfoText = _achieveInfoLayer.transform.Find("AchieveInfo").gameObject.GetComponent <Text>(); _achieveDetailFirstPawn = _achieveInfoLayer.transform.Find("AchieveInfo/Pawn1").gameObject.GetComponent <PawnDisplayer>(); _achieveDetailSecondPawn = _achieveInfoLayer.transform.Find("AchieveInfo/Pawn2").gameObject.GetComponent <PawnDisplayer>(); _achieveDetailFirstPawn.disableSendMessage = true; _achieveDetailSecondPawn.disableSendMessage = true; _achieveInfoLayer.gameObject.SetActive(false); AchievementConfig config = AchievementConfig.instance(); int achieveCount = config.getAchieveItemCount(); Transform achieveIconLayer = gameObject.transform.Find("AchieveIconLayer"); _achieveIconGlow = achieveIconLayer.Find("IconGlow").GetComponent <Image>(); _achieveIconGlow.gameObject.SetActive(false); for (int i = 0; i < achieveCount; ++i) { AchievementConfig.AchieveItem item = config.getAchieveItemByIndex(i); bool finished = PlayerPrefs.GetInt("finished_achieve_" + item.id, 0) > 0; Transform achieveIcon = achieveIconLayer.Find("Achieve" + i); if (achieveIcon) { Image icon = achieveIcon.gameObject.GetComponent <Image>(); _achieveIcons.Add(icon); } } refresh(); }
// Use this for initialization void Awake() { _label = gameObject.GetComponent <Text>(); _firstEliminatedPawn = gameObject.transform.Find("Pawn1").GetComponent <PawnDisplayer>(); _firstEliminatedPawn.gameObject.SetActive(false); }
private void onPawnNeighborMarkUpdateDone(PawnDisplayer pawn) { --_updatingPawnCountToWait; if (_updatingPawnCountToWait <= 0) { collectAndEliminateAdjacentPawns(); } }