void Initialize() { m_Transform = transform; m_lblReport = m_Transform.Find("txtBattleReport").GetComponentsInChildren<UILabel>(true)[0]; m_imgReport = m_Transform.Find("imgBattleReport").GetComponentsInChildren<UISprite>(true)[0]; m_bgReport = m_Transform.Find("bgBattleReport").GetComponentsInChildren<UISlicedSprite>(true)[0]; }
// Use this for initialization void Start() { this.spr = (UISprite)this.gameObject.GetComponent<UISprite>(); this.sspr = (UISlicedSprite)this.gameObject.GetComponent<UISlicedSprite>(); if (this.spr!=null) this.spr.color = new Color32(GetThemeColor.COLOR_R,GetThemeColor.COLOR_G,GetThemeColor.COLOR_B,255); if (this.sspr!=null) this.sspr.color = new Color32(GetThemeColor.COLOR_R,GetThemeColor.COLOR_G,GetThemeColor.COLOR_B,255); }
void Awake() { globals = Globals.GetInstance(); itemsPrices = UIRootGO.GetComponent<ItemsPrices>(); itemNumberLabel = itemNumberGO.GetComponent<UILabel>(); itemPriceLabel = itemPriceGO.GetComponent<UILabel>(); itemPriceIcon = itemPriceIconGO.GetComponent<UISlicedSprite>(); }
void Awake() { gameObject.AddComponent<MogoFakeClick>().ReletedClassType = ReleadClassType.Type_InstanceUI; if (transform.FindChild("InstanceLevel" + ID + "BG") != null) { m_ssBG = transform.FindChild("InstanceLevel" + ID + "BG").GetComponentsInChildren<UISlicedSprite>(true)[0]; } }
void Start() { _slider = GetComponent<UISlider>(); _controller = CRUtility.GetComponentInParent<CRController>(transform); _health = _controller.creature.attributeManager.GetResource(CRResourceType.HEALTH); _foreground = transform.FindChild("Foreground").GetComponent<UISlicedSprite>(); _conditionManager = _controller.creature.conditionManager; }
void Start() { m_spIconActive = m_myTransform.FindChild("SkillIcon" + ID + "Core/" + "SkillIcon" + ID + "Active").GetComponentsInChildren<UISprite>(true)[0]; m_ssIconBGDown = m_myTransform.FindChild("SkillIcon" + ID + "Core/" + "SkillIcon" + ID + "BGDown").GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssIconChooseSign = m_myTransform.FindChild("SkillIcon" + ID + "ChooseSign").GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssIconFG = m_myTransform.FindChild("SkillIcon" + ID + "Core/" + "SkillIcon" + ID + "FG").GetComponentsInChildren<UISprite>(true)[0]; if (m_strActiveIconName != "") { m_spIconActive.atlas = MogoUIManager.Instance.GetSkillIconAtlas(); m_spIconActive.spriteName = m_strActiveIconName; m_ssIconFG.atlas = MogoUIManager.Instance.GetSkillIconAtlas(); m_ssIconFG.spriteName = "bb_daojugeguangzhe"; m_spIconActive.ShowAsWhiteBlack(!m_bIsAcitve); m_ssIconFG.ShowAsWhiteBlack(!m_bIsAcitve); } }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); Initialize(); m_transStrenthenDialogIconList = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogIconList"]); m_dragCamera = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogIconListCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].topLeft = GameObject.Find("EquipmentUIIconListBGTopLeft").transform; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].bottomRight = GameObject.Find("EquipmentUIIconListBGBottomRight").transform; m_dragableCamera = m_dragCamera.GetComponentsInChildren<MyDragableCamera>(true)[0]; m_dragableCamera.LeftArrow = FindTransform("StrenthenDialogIconListArrowU").gameObject; m_dragableCamera.RightArrow = FindTransform("StrenthenDialogIconListArrowD").gameObject; m_bcStrenthUIBoxCollider = FindTransform("StrenthUIBoxCollider").GetComponentsInChildren<BoxCollider>(true)[0]; //m_goStrenthenDialogStarRewardStarLevel = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogStarRewardStarLevel"]).gameObject; //m_goStarLevelListPosBegin = m_myTransform.FindChild(m_widgetToFullName["StarLevelListPosBegin"]).gameObject; //m_StrenthenStarLevelInfo = m_goStrenthenDialogStarRewardStarLevel.AddComponent<StrenthenStarLevelInfo>(); //if (m_StrenthenStarLevelInfo != null) // m_StrenthenStarLevelInfo.CreateStarLevelInfo(m_goStrenthenDialogStarRewardStarLevel.transform, m_goStarLevelListPosBegin.transform.localPosition); m_lblBaseEquipType = m_myTransform.FindChild(m_widgetToFullName["BaseAttributeEquipTypeText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblStarLevel = m_myTransform.FindChild(m_widgetToFullName["StarLevelText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseAttribute = m_myTransform.FindChild(m_widgetToFullName["BaseAttributeText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblAfterAttribute = m_myTransform.FindChild(m_widgetToFullName["AfterAttributeText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblEquipmentLevel = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; for (int i = 0; i < 10; i++) { m_arrStrenthLevelBG[i] = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogLevelBG" + i]).gameObject; m_arrStrenthLevelBG[i].transform.localPosition = new Vector3( m_arrStrenthLevelBG[0].transform.localPosition.x + 53 * i, m_arrStrenthLevelBG[i].transform.localPosition.y, m_arrStrenthLevelBG[i].transform.localPosition.z); UIFilledSprite fs = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogLevelFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_fsEquipmentExpList[i] = fs; m_fsEquipmentExpList[i].transform.localPosition = new Vector3( m_fsEquipmentExpList[0].transform.localPosition.x + 53 * i, m_fsEquipmentExpList[i].transform.localPosition.y, m_fsEquipmentExpList[i].transform.localPosition.z); } m_ssEquipmentImage = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogImgFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_lblBaseReward0Title = FindTransform("LevelReward0BaseTitle").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward1Title = FindTransform("LevelReward1BaseTitle").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward2Title = FindTransform("LevelReward2BaseTitle").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward0Num = FindTransform("LevelReward0BaseNum").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward1Num = FindTransform("LevelReward1BaseNum").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward2Num = FindTransform("LevelReward2BaseNum").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward0TextAnimation = FindTransform("LevelReward0BaseTextAnimation").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward1TextAnimation = FindTransform("LevelReward1BaseTextAnimation").GetComponentsInChildren<UILabel>(true)[0]; m_lblBaseReward2TextAnimation = FindTransform("LevelReward2BaseTextAnimation").GetComponentsInChildren<UILabel>(true)[0]; m_goLevelRewardAfter = FindTransform("GOLevelRewardAfter").gameObject; m_lblAfterReward0 = m_myTransform.FindChild(m_widgetToFullName["LevelReward0AfterText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblAfterReward1 = m_myTransform.FindChild(m_widgetToFullName["LevelReward1AfterText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblAfterReward2 = m_myTransform.FindChild(m_widgetToFullName["LevelReward2AfterText"]).GetComponentsInChildren<UILabel>(true)[0]; // 强化按钮 m_goStrenthenDialogStrenth = FindTransform("StrenthenDialogStrenth").gameObject; m_spStrenthenDialogStrenthBGUp = FindTransform("StrenthenDialogStrenthBGUp").GetComponentsInChildren<UISprite>(true)[0]; m_lblNeedGold = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogCostGold"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblCurrentGold = m_myTransform.FindChild(m_widgetToFullName["StrenthUICrrentGoldNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblNeedLevel = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogNeedLevelText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblCost = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogCostText"]).GetComponentsInChildren<UILabel>(true)[0]; // 强化需要的材料 m_lblNeedMaterial1 = FindTransform("StrenthenDialogCostMaterial1").GetComponentsInChildren<UILabel>(true)[0]; m_lblNeedMaterial2 = FindTransform("StrenthenDialogCostMaterial2").GetComponentsInChildren<UILabel>(true)[0]; m_spNeedMaterialIcon1 = FindTransform("StrenthenDialogCostMaterial1Icon").GetComponentsInChildren<UISprite>(true)[0]; m_spNeedMaterialIcon2 = FindTransform("StrenthenDialogCostMaterial2Icon").GetComponentsInChildren<UISprite>(true)[0]; m_goNeedMaterial2 = FindTransform("GOStrenthenDialogCostMaterial2").gameObject; // 强化需要的材料不足,显示的指引按钮 m_goGOMaterialObtainTip = m_myTransform.FindChild(m_widgetToFullName["GOMaterialObtainTip"]).gameObject; m_goStrenthenDialogMaterialTip = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogMaterialTip"]).gameObject; m_spStrenthenDialogMaterialTipBGUp = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogMaterialTipBGUp"]).GetComponentsInChildren<UISprite>(true)[0]; m_spStrenthenDialogMaterialTipBGDown = m_myTransform.FindChild(m_widgetToFullName["StrenthenDialogMaterialTipBGDown"]).GetComponentsInChildren<UISprite>(true)[0]; for (int i = 0; i < ICONGRIDNUM; ++i) { //obj = (GameObject)Instantiate(Resources.Load("GUI/StrenthenDialogIconGrid")); //obj.transform.parent = m_transStrenthenDialogIconList ; //obj.transform.localPosition = new Vector3(0,-ICONGRIDSPACE * i, 0); //obj.transform.localScale = new Vector3(0.0008f, 0.0008f, 0.0008f); //obj.GetComponentsInChildren<MyDragCamera>(true)[0].RelatedCamera = m_dragCamera; //obj.name = "EquipmentGrid"+i.ToString(); //var s = m_transStrenthenDialogIconList.GetComponentsInChildren<MogoSingleButtonList>(true)[0] as MogoSingleButtonList; //s.SingleButtonList.Add(obj.GetComponentsInChildren<MogoSingleButton>(true)[0]); //obj.AddComponent<StrenthenEquipmentGrid>().id = i; //m_listEquipmentGrid.Add(obj); int index = i; AssetCacheMgr.GetUIInstance("StrenthenDialogIconGrid.prefab", (prefab, guid, go) => { GameObject obj = (GameObject)go; obj.transform.parent = m_transStrenthenDialogIconList; obj.transform.localPosition = new Vector3(0, ICONGRIDSPACE * index, 0); obj.transform.localScale = new Vector3(0.0008f, 0.0008f, 1); obj.GetComponentsInChildren<MyDragCamera>(true)[0].RelatedCamera = m_dragCamera; obj.name = "EquipmentGrid" + index.ToString(); var s = m_transStrenthenDialogIconList.GetComponentsInChildren<MogoSingleButtonList>(true)[0] as MogoSingleButtonList; s.SingleButtonList.Add(obj.GetComponentsInChildren<MogoSingleButton>(true)[0]); obj.AddComponent<StrenthenEquipmentGrid>().id = index; Transform tranStarLevel = obj.transform.FindChild("StrenthenDialogIconGridStarLevelList"); StrenthenStarLevelInfo strenthenStarLevelInfo = tranStarLevel.gameObject.AddComponent<StrenthenStarLevelInfo>(); if (strenthenStarLevelInfo != null) strenthenStarLevelInfo.CreateStarLevelInfo(tranStarLevel, new Vector3(0, 0, 0)); m_listEquipmentGrid.Add(obj); ShowEquipmentUpSign(index, false); if (m_listEquipmentGrid.Count == ICONGRIDNUM) { EquipmentUIViewManager.Instance.IsCanClick = true; EventDispatcher.TriggerEvent(BodyEnhanceManager.ON_SHOW); if (MogoUIManager.Instance.StrenthUILoaded != null) { MogoUIManager.Instance.StrenthUILoaded(); } // 滑动形式需要处理(翻页不需要设置) if (!m_dragableCamera.IsMovePage) { m_dragableCamera.FPageHeight = ICONGRIDSPACE * ICON_GRID_ONE_PAGE; m_dragableCamera.MAXY = ICON_OFFSET_Y; if (m_listEquipmentGrid.Count > ICON_GRID_ONE_PAGE) m_dragableCamera.MINY = (m_listEquipmentGrid.Count - ICON_GRID_ONE_PAGE) * ICONGRIDSPACE + ICON_OFFSET_Y; else m_dragableCamera.MINY = m_dragableCamera.MAXY; } MogoGlobleUIManager.Instance.ShowWaitingTip(false); } if (index == 0) StrenthTabDown(index); else StrenthTabUp(index); }); } }
/// <summary> /// Calculate the specified sprite's inner bounds relative to the specified root. /// </summary> public static Bounds CalculateRelativeInnerBounds(Transform root, UISlicedSprite sprite) { Matrix4x4 toLocal = root.worldToLocalMatrix; Vector2 size = sprite.relativeSize; Vector2 offset = sprite.pivotOffset; Transform toWorld = sprite.cachedTransform; float x = (offset.x + 0.5f) * size.x; float y = (offset.y - 0.5f) * size.y; size *= 0.5f; float sx = toWorld.localScale.x; float sy = toWorld.localScale.y; // Get the border in pixels Vector4 border = sprite.border; // Convert pixels to relative coordinates if (sx != 0f) { border.x /= sx; border.z /= sx; } if (sy != 0f) { border.y /= sy; border.w /= sy; } // Calculate the relative dimensions float left = x - size.x + border.x; float right = x + size.x - border.z; float top = y - size.y + border.y; float bottom = y + size.y - border.w; // Start with the corner of the widget Vector3 v = new Vector3(left, top, 0f); v = toWorld.TransformPoint(v); v = toLocal.MultiplyPoint3x4(v); Bounds b = new Bounds(v, Vector3.zero); // Repeat for the other 3 corners v = new Vector3(left, bottom, 0f); v = toWorld.TransformPoint(v); v = toLocal.MultiplyPoint3x4(v); b.Encapsulate(v); v = new Vector3(right, bottom, 0f); v = toWorld.TransformPoint(v); v = toLocal.MultiplyPoint3x4(v); b.Encapsulate(v); v = new Vector3(right, top, 0f); v = toWorld.TransformPoint(v); v = toLocal.MultiplyPoint3x4(v); b.Encapsulate(v); return b; }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); Initialize(); m_transPackageItemList = m_myTransform.FindChild(m_widgetToFullName["InsetDialogPackageItemList"]); m_transInsetDialogIconList = m_myTransform.FindChild(m_widgetToFullName["InsetDialogIconList"]); m_transInsetHoleList = m_myTransform.FindChild(m_widgetToFullName["InsetDialogBody"]); m_dragCamera = FindTransform("InsetDialogPackageItemListCamera").GetComponentsInChildren<Camera>(true)[0]; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_dragIconCamera = FindTransform("InsetDialogIconListCamera").GetComponentsInChildren<Camera>(true)[0]; m_dragIconCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_dragIconCamera.GetComponentsInChildren<UIViewport>(true)[0].topLeft = GameObject.Find("EquipmentUIIconListBGTopLeft").transform; m_dragIconCamera.GetComponentsInChildren<UIViewport>(true)[0].bottomRight = GameObject.Find("EquipmentUIIconListBGBottomRight").transform; m_dragableIconCamera = m_dragIconCamera.GetComponentsInChildren<MyDragableCamera>(true)[0]; m_dragableIconCamera.LeftArrow = FindTransform("InsetDialogIconListArrowU").gameObject; m_dragableIconCamera.RightArrow = FindTransform("InsetDialogIconListArrowD").gameObject; m_ssInsetEquipmentIcon = m_myTransform.FindChild(m_widgetToFullName["InsetDialogEquipFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssInsetEquipmentIconBG = m_myTransform.FindChild(m_widgetToFullName["InsetDialogEquipBG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_goPackageArea = m_myTransform.FindChild(m_widgetToFullName["InsetDialogPackageListPos"]).gameObject; m_goInsetDialogDiamondTip = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoTip"]).gameObject; m_lblDiamondTipDesc = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailEffectNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblDiamondTipLevel = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblDiamondTipName = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblDiamondTipType = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailTypeNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_ssDiamondTipIcon = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssDiamondTipIconBG = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailImageBG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_jewelHoleObj = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole"]).gameObject; m_jewelHole1 = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole0"]).gameObject; m_jewelHole2 = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole1"]).gameObject; m_jewelHole3 = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole2"]).gameObject; m_jewelHole4 = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole3"]).gameObject; m_myTransform.FindChild(m_widgetToFullName["InsetDialog1BGMask"]).gameObject.AddComponent<InsetBGMask>(); m_jewelHoleList = new List<GameObject>(); m_jewelHoleList.Add(m_jewelHole1); m_jewelHoleList.Add(m_jewelHole2); m_jewelHoleList.Add(m_jewelHole3); m_jewelHoleList.Add(m_jewelHole4); m_jewleHoleOriginalPos = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHolePos"]).localPosition; m_dialog1 = m_myTransform.FindChild(m_widgetToFullName["InsetDialog1"]).gameObject; m_dialog2 = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2"]).gameObject; m_dialog2InfoDetail = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2Info"]).gameObject; m_dialog2Title = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2TopTitle"]).GetComponentsInChildren<UILabel>(true)[0]; ; m_dialog2EquipIconFg = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2IconFg"]).GetComponentsInChildren<UISprite>(true)[0]; m_dialog2EquipIconBg = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2IconBg"]).GetComponentsInChildren<UISprite>(true)[0]; m_dialog2EquipName = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2EquipName"]).GetComponentsInChildren<UILabel>(true)[0]; m_dialog2LevelNeed = m_myTransform.FindChild(m_widgetToFullName["InsetDialog2NeedLevel"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblJewelListDesc = m_myTransform.FindChild(m_widgetToFullName["InsetDialogPackageText"]).GetComponentsInChildren<UILabel>(true)[0]; m_texInsetSucessSign = m_myTransform.FindChild(m_widgetToFullName["InsetUISucessSign"]).GetComponentsInChildren<UITexture>(true)[0]; m_texComposeSucessSign = m_myTransform.FindChild(m_widgetToFullName["InsetUIComposeSucessSign"]).GetComponentsInChildren<UITexture>(true)[0]; m_myTransform.FindChild(m_widgetToFullName["InsetDialog1Buy"]).gameObject.AddComponent<MogoUIListener>().MogoOnClick = () => { EventDispatcher.TriggerEvent(InsetManager.ON_BUY); }; for (int i = 0; i < 4; ++i) { m_arrInsetHoleIcon[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "FG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_arrInsetHoleUnloadSign[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "Unload"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_arrInsetHoleUpSign[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "Update"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_arrInsetHoleTooltip[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "ToolTip"]).gameObject; m_arrInsetHoleBGDown[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "BG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_arrInsetHoleBGUp[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "BGUp"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_arrInsetHoleTypeName[i] = m_myTransform.FindChild(m_widgetToFullName["InsetDialogHole" + i + "TypeName"]).GetComponentsInChildren<UILabel>(true)[0]; } for (int i = 0; i < 6; ++i) { m_gotransformList.Add(m_myTransform.FindChild(m_widgetToFullName["transformList" + i]).gameObject); } for (int i = 0; i < 6; i++) { if (i > 0) { m_gotransformList[i].transform.localPosition = new Vector3( m_gotransformList[0].transform.localPosition.x + PACKAGEITEMNUMONEPAGE * PACKAGEITEMSPACE * i, m_gotransformList[i].transform.localPosition.y, m_gotransformList[i].transform.localPosition.z); } } bool m_bIsAllLoaded = false; for (int i = 0; i < ICONGRIDNUM; ++i) { int index = i; AssetCacheMgr.GetUIInstance("StrenthenDialogIconGrid.prefab", (prefab, guid, go) => { GameObject obj = (GameObject)go; obj.transform.parent = m_transInsetDialogIconList; obj.transform.localPosition = new Vector3(0, ICONGRIDSPACE * index, 0); obj.transform.localScale = new Vector3(0.0008f, 0.0008f, 1); obj.GetComponentsInChildren<MyDragCamera>(true)[0].RelatedCamera = m_dragIconCamera; obj.GetComponentsInChildren<MyDragCamera>(true)[0].m_goDraggableArea = m_goPackageArea; obj.name = "InsetIconListIcon" + index.ToString(); var s = m_transInsetDialogIconList.GetComponentsInChildren<MogoSingleButtonList>(true)[0] as MogoSingleButtonList; s.SingleButtonList.Add(obj.GetComponentsInChildren<MogoSingleButton>(true)[0]); obj.AddComponent<InsetUIEquipmentGrid>().id = index; m_listEquipmentGrid.Add(obj); if (m_listEquipmentGrid.Count == ICONGRIDNUM) { // 滑动形式需要处理(翻页不需要设置) if (!m_dragableIconCamera.IsMovePage) { m_dragableIconCamera.FPageHeight = ICONGRIDSPACE * ICON_GRID_ONE_PAGE; m_dragableIconCamera.MAXY = ICON_OFFSET_Y; if (m_listEquipmentGrid.Count > ICON_GRID_ONE_PAGE) m_dragableIconCamera.MINY = (m_listEquipmentGrid.Count - ICON_GRID_ONE_PAGE) * ICONGRIDSPACE + ICON_OFFSET_Y; else m_dragableIconCamera.MINY = m_dragableIconCamera.MAXY; } } if (!m_bIsAllLoaded && m_listPackageGrid.Count == PACKAGEITEMNUM && m_listEquipmentGrid.Count == ICONGRIDNUM) { EventDispatcher.TriggerEvent(InsetManager.ON_INSET_SHOW); if (MogoUIManager.Instance.InsetUILoaded != null) { MogoUIManager.Instance.InsetUILoaded(); MogoUIManager.Instance.InsetUILoaded = null; } m_bIsAllLoaded = true; } if (index == 0) InsetTabDown(index); else InsetTabUp(index); }); } for (int i = 0; i < PACKAGEITEMNUM; ++i) { int index = i; AssetCacheMgr.GetUIInstance("InsetDialogPackageGrid.prefab", (prefab, guid, go) => { GameObject obj = (GameObject)go; obj.name = "InsetDialogPackageGrid" + index; obj.transform.parent = m_transPackageItemList; obj.transform.localPosition = new Vector3(PACKAGEITEMSPACE * index - 0.012f, 0, 0); obj.transform.localScale = new Vector3(0.0008f, 0.0008f, 1); m_listItemFG.Add(obj.transform.GetComponentsInChildren<UISlicedSprite>(true)[1]); m_listItemNum.Add(obj.transform.GetComponentsInChildren<UILabel>(true)[0]); m_listItemBG.Add(obj.transform.GetComponentsInChildren<UISlicedSprite>(true)[0]); obj.GetComponentsInChildren<MyDragCamera>(true)[0].RelatedCamera = m_dragCamera; obj.AddComponent<InsetUIPackageGrid>().ID = index; m_listPackageGrid.Add(obj); if (!m_bIsAllLoaded && m_listPackageGrid.Count == PACKAGEITEMNUM && m_listEquipmentGrid.Count == ICONGRIDNUM) { EventDispatcher.TriggerEvent(InsetManager.ON_INSET_SHOW); if (MogoUIManager.Instance.InsetUILoaded != null) { //Debug.LogError("InsetUILoaded != null"); MogoUIManager.Instance.InsetUILoaded(); MogoUIManager.Instance.InsetUILoaded = null; } //else //{ // Debug.LogError("InsetUILoaded == null"); //} m_bIsAllLoaded = true; MogoGlobleUIManager.Instance.ShowWaitingTip(false); } }); } }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); Initialize(); m_dragCamera = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogIconListCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].topLeft = GameObject.Find("EquipmentUIIconListBGTopLeft").transform; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].bottomRight = GameObject.Find("EquipmentUIIconListBGBottomRight").transform; m_dragableCamera = m_dragCamera.GetComponentsInChildren<MyDragableCamera>(true)[0]; m_dragableCamera.LeftArrow = FindTransform("ComposeDialogIconListArrowU").gameObject; m_dragableCamera.RightArrow = FindTransform("ComposeDialogIconListArrowD").gameObject; m_transPanelTable = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogIconListPanelTable"]); m_goGOComposeDialogBodyPearlUp = m_myTransform.FindChild(m_widgetToFullName["GOComposeDialogBodyPearlUp"]).gameObject; m_goGOComposeDialogBodyPearlLeft = m_myTransform.FindChild(m_widgetToFullName["GOComposeDialogBodyPearlLeft"]).gameObject; m_goGOComposeDialogBodyPearlRight = m_myTransform.FindChild(m_widgetToFullName["GOComposeDialogBodyPearlRight"]).gameObject; m_goGOComposeDialogBodyPearlFinal = m_myTransform.FindChild(m_widgetToFullName["GOComposeDialogBodyPearlFinal"]).gameObject; m_goGOComposeDialogBodyPearlUp.AddComponent<InventoryGrid>(); m_goGOComposeDialogBodyPearlLeft.AddComponent<InventoryGrid>(); m_goGOComposeDialogBodyPearlRight.AddComponent<InventoryGrid>(); m_goGOComposeDialogBodyPearlFinal.AddComponent<InventoryGrid>(); m_ssComposePearlLeft = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogBodyPearlLeft"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssComposePearlRight = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogBodyPearlRight"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssComposePearlUp = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogBodyPearlUp"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_ssComposePearlFinal = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogBodyPearlFinal"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_goComposeNowBtn = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogComposeNow"]).gameObject; m_goComposeBtn = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogCompose"]).gameObject; for (int i = 0; i < 9; ++i) { m_bGridStatus[i] = false; } m_texUIBG = m_myTransform.FindChild(m_widgetToFullName["ComposeDialogBodyBGThing0"]).GetComponentsInChildren<UITexture>(true)[0]; }
// Use this for initialization void Start() { mScale = new Vector3(Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); mPlayerID = playerID; mUIButton = gameObject.GetComponent<UISlicedSprite>(); mAni = gameObject.GetComponent<UISpriteAnimation>(); if(mAni)mAni.enabled = false; mUpNDown = gameObject.GetComponent<UpNDown>(); }
private void InitGUIVariables() { eventWarningLabel = eventWarningLabelGo.GetComponent<UILabel>(); gameTimeLabel = gameTimeLabelGo.GetComponent<UILabel>(); gameTimeVarLabel = gameTimeVarLabelGo.GetComponent<UILabel>(); scoreLabel = scoreLabelGo.GetComponent<UILabel>(); scoreVarLabel = scoreVarLabelGo.GetComponent<UILabel>(); satisfyBarLabel = satisfyBarLabelGo.GetComponent<UILabel>(); mayorFacesSprite = mayorFacesSpriteGo.GetComponent<UISlicedSprite>(); totalScoreLabel = totalScoreLabelGo.GetComponent<UILabel>(); totalScoreVarLabel = totalScoreVarLabelGo.GetComponent<UILabel>(); replayButton = replayButtonGo.GetComponent<UIButton>(); totalScoreVarLabelGo.SetActive(false); replayButtonGo.SetActive(false); }
public override void CallWhenLoadResources() { m_instance = this; ID = MFUIManager.MFUIID.BattleMainUI; MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject); FillFullNameData(m_myTransform); m_goMainUIBottom = m_myTransform.FindChild(m_widgetToFullName["Bottom"]).gameObject; m_goMainUIBottomLeft = m_myTransform.FindChild(m_widgetToFullName["BottomLeft"]).gameObject; m_goMainUIBottomRight = m_myTransform.FindChild(m_widgetToFullName["BottomRight"]).gameObject; m_goMainUITop = m_myTransform.FindChild("Top").gameObject; m_goMainUITopLeft = m_myTransform.FindChild(m_widgetToFullName["TopLeft"]).gameObject; m_goMainUITopRight = m_myTransform.FindChild(m_widgetToFullName["TopRight"]).gameObject; m_goController = m_myTransform.FindChild("BottomLeft/Controller").gameObject; m_goController.AddComponent<ControlStick>(); // 设置各部分控件的Camera Camera camera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_goMainUIBottom.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera; m_goMainUIBottomLeft.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera; m_goMainUIBottomRight.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera; m_goMainUITop.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera; m_goMainUITopLeft.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera; m_goMainUITopRight.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera; m_goController.GetComponentsInChildren<ControlStick>(true)[0].RelatedCamera = camera; m_myTransform.FindChild(m_widgetToFullName["MainUIBG"]).gameObject.AddComponent<TouchControll>(); m_fsNormalAttackCD = m_myTransform.FindChild(m_widgetToFullName["NormalAttackCD"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_goSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttack"]).gameObject; m_goCancelManaged = m_myTransform.FindChild(m_widgetToFullName["CancelManagedBtn"]).gameObject; m_lblPlayerBlood = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerBloodText"]).GetComponentsInChildren<UILabel>(true)[0]; m_fsPlayerBloodFG = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerBloodFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_ssPlayerHead = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerHead"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_fsPlayerAnger = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerAngerFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_fsPlayerExp = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_fsAffectCD = m_myTransform.FindChild(m_widgetToFullName["AffectCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_fsAffectCD.color = new Color(0.5f, 0.5f, 0.5f); m_fsOutputCD = m_myTransform.FindChild(m_widgetToFullName["OutputCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_fsOutputCD.color = new Color(0.5f, 0.5f, 0.5f); m_fsMoveCD = m_myTransform.FindChild(m_widgetToFullName["MoveCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_fsMoveCD.color = new Color(0.5f, 0.5f, 0.5f); m_fsSpriteSkillCD = FindTransform("MainUISpriteSkillBtnCD").GetComponentsInChildren<UIFilledSprite>(true)[0]; m_fsSpriteSkillCD.color = new Color(0.5f, 0.5f, 0.5f); m_hpBottleCD = m_myTransform.FindChild(m_widgetToFullName["HpCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; //m_hpBottleCD.atlas = MogoUIManager.Instance.GetSkillIconAtlas(); m_fsSpecialCD = m_myTransform.FindChild(m_widgetToFullName["SpecialCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite; m_fsNormalTargetBlood = m_myTransform.FindChild(m_widgetToFullName["NormalTargetBloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; //m_fsBossTargetBlood = m_myTransform.FindChild(m_widgetToFullName["BossTargetBloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_member1 = m_myTransform.FindChild(m_widgetToFullName["TeamMember1"]).gameObject; m_member2 = m_myTransform.FindChild(m_widgetToFullName["TeamMember2"]).gameObject; m_member3 = m_myTransform.FindChild(m_widgetToFullName["TeamMember3"]).gameObject; m_member1Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember1LevelBG"]).GetComponentsInChildren<UISprite>(true)[0]; m_member2Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember2LevelBG"]).GetComponentsInChildren<UISprite>(true)[0]; m_member3Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember3LevelBG"]).GetComponentsInChildren<UISprite>(true)[0]; m_fsMember1Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember1BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_fsMember2Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember2BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_fsMember3Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember3BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_lblSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttackText"]).GetComponentsInChildren<UILabel>(true)[0]; m_spSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttackSprite"]).GetComponentsInChildren<UISprite>(true)[0]; //m_comboAttack = m_myTransform.FindChild(m_widgetToFullName["ComboAttack"]).GetComponentsInChildren<ComboAttack>(true)[0]; m_comboAttack = m_myTransform.FindChild(m_widgetToFullName["ComboAttack"]).gameObject.AddComponent<ComboAttack>(); m_bloodAnim = m_fsPlayerBloodFG.transform.parent.GetComponentsInChildren<MogoBloodAnim>(true)[0]; m_bossBloodAnim0 = m_myTransform.FindChild(m_widgetToFullName["BossTargetBlood"]).GetComponentsInChildren<MogoBloodAnim>(true)[0]; m_smallBossBloodAnim0 = m_myTransform.FindChild(m_widgetToFullName["SmallBossTargetBlood"]).GetComponentsInChildren<MogoBloodAnim>(true)[0]; for (int i = 0; i < 5; ++i) { //////Mogo.Util.LoggerHelper.Debug(i + " !!!!!!!!!!!!!!!!!!!!!!!!!!!!"); m_fsBossTargetBloodList[i] = m_myTransform.FindChild(m_widgetToFullName["BossTargetBloodFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_fsSmallBossTargetBloodList[i] = m_myTransform.FindChild(m_widgetToFullName["SmallBossTargetBloodFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0]; } // 左上角玩家信息Pos m_goMainUIPlayerInfo = FindTransform("MainUIPlayerInfo").gameObject; m_vecMainUIPlayerInfoPosDefault = FindTransform("MainUIPlayerInfoPosDefault").transform.localPosition; m_vecMainUIPlayerInfoPosPVP = FindTransform("MainUIPlayerInfoPosPVP").transform.localPosition; // 占塔贡献榜 m_goOccupyTowerRank = FindTransform("OccupyTowerRank").gameObject; m_lblOccupyTowerRankTitle = FindTransform("OccupyTowerRankTitle").GetComponentsInChildren<UILabel>(true)[0]; m_listOccupyTowerRank.Clear(); for (int rank = 1; rank <= MAX_OCCUPY_TOWER_RANK; rank++) { UILabel rankLabel = FindTransform(string.Format("OccupyTowerRank{0}", rank)).GetComponentsInChildren<UILabel>(true)[0]; m_listOccupyTowerRank.Add(rankLabel); } // 占塔战斗信息 m_goOccupyTowerNotice = FindTransform("OccupyTowerNotice").gameObject; m_lblOccupyTowerNoticeCountDownNum = FindTransform("OccupyTowerNoticeCountDownNum").GetComponentsInChildren<UILabel>(true)[0]; m_spOccupyTowerNoticeEnemyBloodFG = FindTransform("OccupyTowerNoticeEnemyBloodFG").GetComponentsInChildren<UISprite>(true)[0]; m_spOccupyTowerNoticeOwnBloodFG = FindTransform("OccupyTowerNoticeOwnBloodFG").GetComponentsInChildren<UISprite>(true)[0]; m_spOccupyTowerNoticeEnemyBloodAnim = FindTransform("OccupyTowerNoticeEnemyBloodAnim").GetComponentsInChildren<UISprite>(true)[0]; m_spOccupyTowerNoticeOwnBloodAnim = FindTransform("OccupyTowerNoticeOwnBloodAnim").GetComponentsInChildren<UISprite>(true)[0]; m_lblOccupyTowerNoticeEnemyBloodNum = FindTransform("OccupyTowerNoticeEnemyBloodNum").GetComponentsInChildren<UILabel>(true)[0]; m_lblOccupyTowerNoticeOwnBloodNum = FindTransform("OccupyTowerNoticeOwnBloodNum").GetComponentsInChildren<UILabel>(true)[0]; m_lblOccupyTowerNoticeEnemyScore = FindTransform("OccupyTowerNoticeEnemyScore").GetComponentsInChildren<UILabel>(true)[0]; m_lblOccupyTowerNoticeOwnScore = FindTransform("OccupyTowerNoticeOwnScore").GetComponentsInChildren<UILabel>(true)[0]; m_occupyTowerNoticeEnemyBloodAnim = FindTransform("OccupyTowerNoticeEnemyBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0]; m_occupyTowerNoticeOwnBloodAnim = FindTransform("OccupyTowerNoticeOwnBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0]; m_lblContributeRankText = m_myTransform.FindChild(m_widgetToFullName["CurrentRankText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblFirstRank = m_myTransform.FindChild(m_widgetToFullName["FirstRank"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblSecRank = m_myTransform.FindChild(m_widgetToFullName["SecondRank"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblTriRank = m_myTransform.FindChild(m_widgetToFullName["TriRank"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblComboAttackNum = m_myTransform.FindChild(m_widgetToFullName["ComboAttackNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblDamageNum = m_myTransform.FindChild(m_widgetToFullName["DamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblInstanceCountDown = m_myTransform.FindChild(m_widgetToFullName["InstanceCountDown"]).GetComponentsInChildren<UILabel>(true)[0]; m_goAutoFight = m_myTransform.FindChild(m_widgetToFullName["AutoFightBtn"]).gameObject; m_goAutoFightText = m_myTransform.FindChild(m_widgetToFullName["AutoFightBtnText"]).gameObject; m_goNormalAttackBtn = m_myTransform.FindChild(m_widgetToFullName["NormalAttack"]).gameObject; m_spNormalAttackFG = m_goNormalAttackBtn.transform.FindChild("NormalAttackBGUp").GetComponent<UISprite>(); m_spNormalAttackBG = m_goNormalAttackBtn.transform.FindChild("NormalAttackBGDown").GetComponent<UISprite>(); m_goSkill0Btn = m_myTransform.FindChild(m_widgetToFullName["Move"]).gameObject; m_goSkill1Btn = m_myTransform.FindChild(m_widgetToFullName["Affect"]).gameObject; m_goSkill2Btn = m_myTransform.FindChild(m_widgetToFullName["Output"]).gameObject; m_goSkill2Btn.AddComponent<MogoDebugWidget>(); m_goBottle = m_myTransform.FindChild(m_widgetToFullName["MainUIItem"]).gameObject; m_goSpriteSkillBtn = FindTransform("MainUISpriteSkillBtn").gameObject; m_goCommunityBtn = m_myTransform.FindChild(m_widgetToFullName["Community"]).gameObject; UILabel lblText = m_goAutoFightText.transform.GetComponentsInChildren<UILabel>(true)[0]; if (LanguageData.dataMap.ContainsKey(180000)) { lblText.text = LanguageData.dataMap[180000].content; } m_goAutoFightStateText = m_myTransform.FindChild(m_widgetToFullName["AutoFightStateText"]).gameObject; m_goAutoFightStateText.SetActive(false); // 角色经验条(Bottom) m_goMainUIPlayerExpList = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpList"]).gameObject; m_goGOMainUIPlayerExpListFG = m_myTransform.FindChild(m_widgetToFullName["GOMainUIPlayerExpListFG"]).gameObject; m_lblMainUIPlayerExpListNum = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpListNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_goMainUIPlayerExpList.SetActive(true); AddPlayerExpFG(); // 试炼之塔提示信息 m_goGOClimbTowerCurrent = m_myTransform.FindChild(m_widgetToFullName["GOClimbTowerCurrent"]).gameObject; m_spClimbTowerCurrentNum1 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum1"]).GetComponentsInChildren<UISprite>(true)[0]; m_spClimbTowerCurrentNum2 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum2"]).GetComponentsInChildren<UISprite>(true)[0]; m_spClimbTowerCurrentNum3 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum3"]).GetComponentsInChildren<UISprite>(true)[0]; // 左上角倒计时 m_goTheCountDown1 = FindTransform("TheCountDown1").gameObject; m_goTheCountDown2 = FindTransform("TDCountDown").gameObject; m_lblTheCountDown1Num = FindTransform("TheCountDown1Num").GetComponentsInChildren<UILabel>(true)[0]; m_lblTheCountDown2Num = FindTransform("TDCountDown").GetComponentsInChildren<UILabel>(true)[0]; m_CDPosClimbTower = FindTransform("CDPosClimbTower").transform.localPosition; m_goDiamondProtectBtn = m_myTransform.FindChild(m_widgetToFullName["DiamondProtectBtn"]).gameObject; m_goBuildingProtectBtn = m_myTransform.FindChild(m_widgetToFullName["BuildingProtectBtn"]).gameObject; // 精灵技能施放 m_goMainUISpriteSkill = FindTransform("MainUISpriteSkill").gameObject; LoadFingerTailUI(); Initialize(); MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID); m_myGameObject.SetActive(false); if (MogoWorld.thePlayer != null) { MogoWorld.thePlayer.UpdateSkillToManager(); } #region 塔防血条 go_tdNotice = m_myTransform.FindChild(m_widgetToFullName["TDNotice"]).gameObject; go_tdTip = m_myTransform.FindChild(m_widgetToFullName["TDTip"]).gameObject; sp_tdBlood = m_myTransform.FindChild(m_widgetToFullName["TDBloodFG"]).gameObject.GetComponentsInChildren<UISprite>(true)[0]; lbl_tdWave = m_myTransform.FindChild(m_widgetToFullName["TDWaveText"]).gameObject.GetComponentsInChildren<UILabel>(true)[0]; lbl_tdTip = m_myTransform.FindChild(m_widgetToFullName["TDTipText"]).gameObject.GetComponentsInChildren<UILabel>(true)[0]; #endregion }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); Initialize(); PreLoadResource(); m_myTransform.FindChild("CommunityUIBottom").GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_goFaceList = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFaceList"]).gameObject; m_goFriendList = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFriendList"]).gameObject; //m_inputText = m_myTransform.FindChild(m_widgetToFullName["CommunityUIPrivateInput"]).GetComponentsInChildren<MogoInput>(true)[0]; m_inputText = m_myTransform.FindChild(m_widgetToFullName["CommunityUIPrivateInput"]).gameObject.AddComponent<MogoInput>(); //m_inputText.text = ""; m_inputText.label = m_myTransform.FindChild(m_widgetToFullName["CommunityUIPrivateInputText"]).GetComponentsInChildren<UILabel>(true)[0]; m_transFaceStartPos = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFaceTopLeft"]); m_transFaceEndPos = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFaceBottomRight"]); m_goFriendButton = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFriendButton"]).gameObject; m_goPrivateInput = m_myTransform.FindChild(m_widgetToFullName["CommunityUIPrivateInput"]).gameObject; m_goAddFriendTip = m_myTransform.FindChild(m_widgetToFullName["CommunityUIAddFriendTip"]).gameObject; m_lblAddFriendTipName = m_myTransform.FindChild(m_widgetToFullName["CommunityUIAddFriendTipName"]).GetComponentsInChildren<UILabel>(true)[0]; m_goFriendGridList = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFriendGridList"]).gameObject; m_camFriendGirdListCamera = m_myTransform.FindChild(m_widgetToFullName["CommunityUIFriendGridCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_camWorldChannelCamera = m_myTransform.FindChild(m_widgetToFullName["WorldCannelDialogCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_camTongChannelCamera = m_myTransform.FindChild(m_widgetToFullName["TongCannelDialogCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_camPrivateChannelCamera = m_myTransform.FindChild(m_widgetToFullName["PrivateCannelDialogCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_camInputTextCamera = m_myTransform.FindChild(m_widgetToFullName["CommunityUIPrivateInputListCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_camFriendGirdListCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_camWorldChannelCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_camTongChannelCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_camPrivateChannelCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_camInputTextCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_equipDetailNeedLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailNeedLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailGrowLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailGrowLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedJob = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailNeedJobType"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailExtra = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailExtraText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailImageFG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_goEquipmentDetailInfo = m_myTransform.FindChild(m_widgetToFullName["PacakgeEquipNewInfo"]).gameObject; for (int i = 0; i < 4; ++i) { m_arrNewDiamondHoleIcon[i] = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDiamonHole" + (i + 9) + "FG"]).GetComponentsInChildren<UISlicedSprite>(true)[0].gameObject; } AddFaceIconToList(); }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); Initialize(); m_lisgGridGO = new List<GameObject>(); m_listGridFG = new List<UISlicedSprite>(); m_listGridBG = new List<UISlicedSprite>(); m_listGridUp = new List<UISlicedSprite>(); m_listGridUpBl = new List<UISprite>(); m_listGridNum = new List<UILabel>(); m_equipDetailLblEquip = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailPutUpText"]).GetComponentsInChildren<UILabel>(true)[0]; m_packageGold = m_myTransform.FindChild(m_widgetToFullName["GoldText"]).GetComponentsInChildren<UILabel>(true)[0]; m_packageDiamon = m_myTransform.FindChild(m_widgetToFullName["DiamonText"]).GetComponentsInChildren<UILabel>(true)[0]; m_packageVolume = m_myTransform.FindChild(m_widgetToFullName["PackageInfoNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_packageDragableCamera = m_myTransform.FindChild(m_widgetToFullName["PackageCamera"]).GetComponentsInChildren<MyDragableCamera>(true)[0]; m_packageDragableCamera.OutOfBoundsMaxPage += OnOutOfBoundsMaxPage; m_packageDragableCamera.OutOfBoundsMinPage += OnOutOfBoundsMinPage; m_packageIcoSingleButtonList = FindTransform("PackageIconList").GetComponentsInChildren<MogoSingleButtonList>(true)[0]; m_playerName = m_myTransform.FindChild(m_widgetToFullName["PlayerNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerLevel = m_myTransform.FindChild(m_widgetToFullName["PlayerLevelText"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerNameAndLevel = m_myTransform.FindChild(m_widgetToFullName["PlayerNameAndLevelText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailName = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailNeedLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; //m_equipDetailGrowLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailGrowLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedJob = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailNeedJobType"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailExtra = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailExtraText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailImageFG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipDetailImageBG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageBG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipDetailImageUsed = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageUsed"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipTipCamera = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailBG"]).GetComponentsInChildren<SimpleDragCamera>(true)[0]; m_equipCurrentDetailImageBG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailImageBG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipCurrentDetailName = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipCurrentDetailNeedLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailNeedLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; //m_equipCurrentDetailGrowLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailGrowLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipCurrentDetailNeedJob = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailNeedJobType"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipCurrentDetailExtra = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailExtraText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipCurrentDetailImageFG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipCurrentDetailImageUsed = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailImageUsed"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipCurrentTipCamera = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDetailBG"]).GetComponentsInChildren<SimpleDragCamera>(true)[0]; m_playerDetailCDDecrease = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeCDDecreaseNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailCrit = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeCritNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeDamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailHit = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeHitNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailPVP = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributePVPNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailWreck = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeWreckNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailPiercing = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributePiercingNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailExplosionBonus = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeExplosionBonusNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailCritResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeCritResistanceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailDefense = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeDefenceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailHealth = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeHealthNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailPVE = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributePVENum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailSpeedUp = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeSpeedUpNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailWreckResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeWreckResistanceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailEarthElemDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeEarthElemDamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailWindElemDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeWindElemDamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailWaterElemDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeWaterElemDamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailFireElemDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeFireElemDamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailGoldElemDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeGoldElemDamageNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailEarthElemResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeEarthElemResistanceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailWindElemResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeWindElemResistanceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailWaterElemResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeWaterElemResistanceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailFireElemResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeFireElemResistenceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerDetailGoldElemResistance = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailAttributeGoldElemResistanceNum"]).GetComponentsInChildren<UILabel>(true)[0]; //m_packageInfoDetailPackage = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailPackage"]).gameObject; //m_packageInfoDetailPlayer = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailPlayer"]).gameObject; m_playerInfoEXP = m_myTransform.FindChild(m_widgetToFullName["PlayerExpFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_playerInfoEnergy = m_myTransform.FindChild(m_widgetToFullName["PlayerEnergyFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0]; m_playerInfoExpNum = m_myTransform.FindChild(m_widgetToFullName["PlayerExpNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerInfoEnergyNum = m_myTransform.FindChild(m_widgetToFullName["PlayerEnergyNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerInfoJob = m_myTransform.FindChild(m_widgetToFullName["PlayerJobName"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerInfoHealth = m_myTransform.FindChild(m_widgetToFullName["PlayerBloodNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerInfoDamage = m_myTransform.FindChild(m_widgetToFullName["PlayerAttackNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerInfoDefense = m_myTransform.FindChild(m_widgetToFullName["PlayerDefenceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_playerInfoPower = m_myTransform.FindChild(m_widgetToFullName["PlayerPowerInfoNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_diamondTipLevel = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_diamondTipType = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailTypeNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_diamondTipDesc = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailEffectNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_diamondTipName = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_ssDiamondTipIcon = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_diamondTipIconBg = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailImageBG"]).GetComponentsInChildren<UISprite>(true)[0]; m_diamondMaxStack = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoDetailMaxStackNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_diamondInfoTip = m_myTransform.FindChild(m_widgetToFullName["DiamondInfoTip"]).gameObject; m_socialTip = m_myTransform.FindChild(m_widgetToFullName["SocialTip"]).gameObject; m_materialTipName = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_materialTipLevel = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_materialTipStack = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailStackNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_materialTipDecs = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailEffectNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_materialTipPrice = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailPriceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_materialTipPriceIcon = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailPriceIcon"]).GetComponentsInChildren<UISprite>(true)[0]; m_materialTipIcon = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_materialTipIconBg = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoDetailImageBG"]).GetComponentsInChildren<UISprite>(true)[0]; m_materialTip = m_myTransform.FindChild(m_widgetToFullName["MaterialInfoTip"]).gameObject; m_propTipName = m_myTransform.FindChild(m_widgetToFullName["PropInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_propTipStack = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailStackNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_propTipDecs = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailEffectNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_propTipPrice = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailPriceNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_propTipPriceIcon = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailPriceIcon"]).GetComponentsInChildren<UISprite>(true)[0]; m_propTipIcon = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_propTipIconBg = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailImageBG"]).GetComponentsInChildren<UISprite>(true)[0]; m_propTip = m_myTransform.FindChild(m_widgetToFullName["PropInfoTip"]).gameObject; m_propTipUseBtn = m_myTransform.FindChild(m_widgetToFullName["PropInfoDetailCompose"]).gameObject; m_equipSlotBelt = m_myTransform.FindChild(m_widgetToFullName["BeltText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotBreast = m_myTransform.FindChild(m_widgetToFullName["BreastPlateText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotCuish = m_myTransform.FindChild(m_widgetToFullName["CuishText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotHand = m_myTransform.FindChild(m_widgetToFullName["HandGuardText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotHead = m_myTransform.FindChild(m_widgetToFullName["HeadEquipText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotNecklace = m_myTransform.FindChild(m_widgetToFullName["NecklaceText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotRingLeft = m_myTransform.FindChild(m_widgetToFullName["RingLeftText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotRingRight = m_myTransform.FindChild(m_widgetToFullName["RingRightText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotShoes = m_myTransform.FindChild(m_widgetToFullName["ShoesText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotShouders = m_myTransform.FindChild(m_widgetToFullName["ShoudersText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipSlotWeapon = m_myTransform.FindChild(m_widgetToFullName["WeaponText"]).GetComponentsInChildren<UILabel>(true)[0]; m_lblDialogTitle = m_myTransform.FindChild(m_widgetToFullName["DialogTitle"]).GetComponentsInChildren<UILabel>(true)[0]; m_goPackageItemGridList = m_myTransform.FindChild(m_widgetToFullName["PackageItemGridList"]).gameObject; m_myTransform.FindChild(m_widgetToFullName["EquipModelImageBG"]).gameObject.AddComponent<EquipModelImge>(); m_texShowCharacterWinBG = m_myTransform.FindChild(m_widgetToFullName["PlayerEquipBGTexBG"]).GetComponentsInChildren<UITexture>(true)[0]; for (int i = 0; i < DIAMONDHOLENUM; ++i) { //m_equipDetailDiamondHoleInfo[i] = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDiamonHole" + i + "Text"]).GetComponentsInChildren<UILabel>(true)[0]; //m_equipCurrentDetailDiamondHoleInfo[i] = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDiamonHole" + i + "Text"]).GetComponentsInChildren<UILabel>(true)[0]; } //string _GridWidgetName = "Item"; //for (int i = 0; i < VOLUME; ++i) //{ // m_listGridFG.Add(m_myTransform.FindChild(m_widgetToFullName[_GridWidgetName + i + "FG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]); // m_listGridUp.Add(m_myTransform.FindChild(m_widgetToFullName[_GridWidgetName + i + "Up"]).GetComponentsInChildren<UISlicedSprite>(true)[0]); // m_listGridNum.Add(m_myTransform.FindChild(m_widgetToFullName[_GridWidgetName + i + "Num"]).GetComponentsInChildren<UILabel>(true)[0]); //} for (int i = 0; i < 4; ++i) { //m_arrNewDiamondHoleIcon[i] = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDiamonHole" + (i + 9) + "FG"]).GetComponentsInChildren<UISlicedSprite>(true)[0].gameObject; //m_arrCurrentDiamondHoleIcon[i] = m_myTransform.FindChild(m_widgetToFullName["PackageEquipCurrentInfoDiamonHole" + (i + 9) + "FG"]).GetComponentsInChildren<UISlicedSprite>(true)[0].gameObject; } basicAttr = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailBasicAttribute"]).gameObject; elemAttr = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailElementAttribute"]).gameObject; Camera mySourceCam = GameObject.Find("MogoMainUI").transform.FindChild("Camera").GetComponentsInChildren<Camera>(true)[0]; m_myTransform.FindChild(m_widgetToFullName["PackageCamera"]).GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = mySourceCam; m_myTransform.FindChild(m_widgetToFullName["EquipCamera"]).GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = mySourceCam; for (int i = 0; i < 40; ++i) { AddPacakgeItemGrid(MogoUIManager.Instance.CommonAtlas); } m_menuTabUpLabelList[(int)MenuUITab.PlayerTab] = m_myTransform.FindChild(m_widgetToFullName["IconPlayerTextUp"]).GetComponent<UILabel>(); m_menuTabUpLabelList[(int)MenuUITab.PackageTab] = m_myTransform.FindChild(m_widgetToFullName["IconPackageTextUp"]).GetComponent<UILabel>(); m_menuTabUpLabelList[(int)MenuUITab.SkillTab] = m_myTransform.FindChild(m_widgetToFullName["IconSkillTextUp"]).GetComponent<UILabel>(); m_menuTabUpLabelList[(int)MenuUITab.TongTab] = m_myTransform.FindChild(m_widgetToFullName["IconTongTextUp"]).GetComponent<UILabel>(); m_menuTabUpLabelList[(int)MenuUITab.SocialTab] = m_myTransform.FindChild(m_widgetToFullName["IconSocialTextUp"]).GetComponent<UILabel>(); m_menuTabUpLabelList[(int)MenuUITab.SettingsTab] = m_myTransform.FindChild(m_widgetToFullName["IconSettingsTextUp"]).GetComponent<UILabel>(); m_menuTabDownLabelList[(int)MenuUITab.PlayerTab] = m_myTransform.FindChild(m_widgetToFullName["IconPlayerTextDown"]).GetComponent<UILabel>(); m_menuTabDownLabelList[(int)MenuUITab.PackageTab] = m_myTransform.FindChild(m_widgetToFullName["IconPackageTextDown"]).GetComponent<UILabel>(); m_menuTabDownLabelList[(int)MenuUITab.SkillTab] = m_myTransform.FindChild(m_widgetToFullName["IconSkillTextDown"]).GetComponent<UILabel>(); m_menuTabDownLabelList[(int)MenuUITab.TongTab] = m_myTransform.FindChild(m_widgetToFullName["IconTongTextDown"]).GetComponent<UILabel>(); m_menuTabDownLabelList[(int)MenuUITab.SocialTab] = m_myTransform.FindChild(m_widgetToFullName["IconSocialTextDown"]).GetComponent<UILabel>(); m_menuTabDownLabelList[(int)MenuUITab.SettingsTab] = m_myTransform.FindChild(m_widgetToFullName["IconSettingsTextDown"]).GetComponent<UILabel>(); m_packageTabLabelList[(int)PackageUITab.EquipmentTab] = m_myTransform.FindChild(m_widgetToFullName["NormalIconText"]).GetComponent<UILabel>(); m_packageTabLabelList[(int)PackageUITab.JewelTab] = m_myTransform.FindChild(m_widgetToFullName["GemIconText"]).GetComponent<UILabel>(); m_packageTabLabelList[(int)PackageUITab.MaterialTab] = m_myTransform.FindChild(m_widgetToFullName["MaterialIconText"]).GetComponent<UILabel>(); foreach (var pair in m_packageTabLabelList) { if (pair.Key == (int)PackageUITab.EquipmentTab) PackageTabDown(pair.Key); else PackageTabUp(pair.Key); } m_playerDetailTabLabelList[(int)PlayerDetailUITab.BasicAttributeTab] = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailBasicAttributeButtonText"]).GetComponent<UILabel>(); m_playerDetailTabLabelList[(int)PlayerDetailUITab.ElementAttributeTab] = m_myTransform.FindChild(m_widgetToFullName["PlayerDetailElementAttributeButtonText"]).GetComponent<UILabel>(); foreach (var pair in m_playerDetailTabLabelList) { if (pair.Key == (int)PlayerDetailUITab.BasicAttributeTab) PlayerDetailTabDown(pair.Key); else PlayerDetailTabUp(pair.Key); } }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); Initialize(); m_transPackageItemList = m_myTransform.FindChild(m_widgetToFullName["DecomposePackageItemList"]); m_dragCamera = m_myTransform.FindChild(m_widgetToFullName["DecomposePackageItemListCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_dragIconCamera = m_myTransform.FindChild(m_widgetToFullName["DecomposeDialogIconListCamera"]).GetComponentsInChildren<Camera>(true)[0]; m_dragCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_dragIconCamera.GetComponentsInChildren<UIViewport>(true)[0].sourceCamera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0]; m_dragIconCamera.GetComponentsInChildren<UIViewport>(true)[0].topLeft = GameObject.Find("EquipmentUIIconListBGTopLeft").transform; m_dragIconCamera.GetComponentsInChildren<UIViewport>(true)[0].bottomRight = GameObject.Find("EquipmentUIIconListBGBottomRight").transform; m_transDecomposeDialogIconList = m_myTransform.FindChild(m_widgetToFullName["DecomposeDialogIconList"]); m_equipDetailName = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoNameText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailNeedLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; //m_equipDetailGrowLevel = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailGrowLevelNum"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailNeedJob = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailNeedJobType"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailExtra = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailExtraText"]).GetComponentsInChildren<UILabel>(true)[0]; m_equipDetailImageFG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageFG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipDetailImageBG = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageBG"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipDetailImageUsed = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailImageUsed"]).GetComponentsInChildren<UISlicedSprite>(true)[0]; m_equipTipCamera = m_myTransform.FindChild(m_widgetToFullName["PackageEquipInfoDetailBG"]).GetComponentsInChildren<SimpleDragCamera>(true)[0]; m_goGODecomposeChooseEquip = m_myTransform.FindChild(m_widgetToFullName["GODecomposeChooseEquip"]).gameObject; m_texGril = m_myTransform.FindChild(m_widgetToFullName["DecomposeLeftGirl"]).GetComponentsInChildren<UITexture>(true)[0]; m_goGODecomposeJewlTip = m_myTransform.FindChild(m_widgetToFullName["GODecomposeJewlTip"]).gameObject; // ChineseData m_myTransform.FindChild(m_widgetToFullName["DecomposeChooseEquipTitle"]).GetComponentsInChildren<UILabel>(true)[0].text = LanguageData.GetContent(46000); m_myTransform.FindChild(m_widgetToFullName["DecomposeChooseEquipAllText"]).GetComponentsInChildren<UILabel>(true)[0].text = LanguageData.GetContent(46002); m_myTransform.FindChild(m_widgetToFullName["DecomposeChooseEquipWasteText"]).GetComponentsInChildren<UILabel>(true)[0].text = LanguageData.GetContent(46001); m_myTransform.FindChild(m_widgetToFullName["DecomposeJewlTipText"]).GetComponentsInChildren<UILabel>(true)[0].text = LanguageData.GetContent(1087); for (int i = 0; i < PACKAGEITEMNUM; ++i) { int index = i; AssetCacheMgr.GetUIInstance("DecomposeDialogPackageGrid.prefab", (prefab, guid, go) => { GameObject obj = (GameObject)go; obj.transform.parent = m_transPackageItemList; obj.transform.localPosition = new Vector3(PACKAGEITEMSPACE * ((index % 5) + index / 10 * 5), -PACKAGEITEMSPACE * ((index / 5) % 2), 0); obj.transform.localScale = new Vector3(0.0008f, 0.0008f, 1); obj.name = "DecomposeGrid" + index.ToString(); obj.GetComponentsInChildren<MyDragCamera>(true)[0].RelatedCamera = m_dragCamera; obj.AddComponent<DecomposeUIEquipmentGrid>().id = index; m_listPackageGrid.Add(obj); obj = obj.transform.FindChild("DecomposeDialogPackageGridCheckBG").gameObject; obj.name = "DecomposeDialogPackageGridCheckBG" + index.ToString(); obj.AddComponent<DecomposeUIEquipmentCheckGrid>().id = index; m_listPackageCheckGridBG.Add(obj); obj = obj.transform.parent.FindChild("DecomposeDialogPackageGridCheckFG").gameObject; obj.SetActive(false); m_listPackageCheckGridFG.Add(obj); obj = obj.transform.parent.FindChild("DecomposeDialogPackageGridLock").gameObject; m_listPackageLock.Add(obj); UISlicedSprite ss = obj.transform.parent.FindChild("DecomposeDialogPackageGridFG").GetComponentsInChildren<UISlicedSprite>(true)[0]; UISlicedSprite ssbg = obj.transform.parent.FindChild("DecomposeDialogPackageGridBG").GetComponentsInChildren<UISlicedSprite>(true)[0]; m_listPackageGridFG.Add(ss); m_listPackageGridBG.Add(ssbg); if (m_listPackageGrid.Count == PACKAGEITEMNUM) { EventDispatcher.TriggerEvent(DecomposeManager.ON_DECOMPOSE_SHOW); if (MogoUIManager.Instance.DecomposeUILoaded != null) { MogoUIManager.Instance.DecomposeUILoaded(); } MogoGlobleUIManager.Instance.ShowWaitingTip(false); } }); } for (int i = 0; i < ICONGRIDNUM; ++i) { int index = i; AssetCacheMgr.GetUIInstance("DecomposeDialogIconGrid.prefab", (prefab, guid, go) => { GameObject obj = (GameObject)go; obj.transform.parent = m_transDecomposeDialogIconList; obj.transform.localPosition = new Vector3(0, -ICONGRIDSPACE * index, 0); obj.transform.localScale = new Vector3(0.0008f, 0.0008f, 1); obj.GetComponentsInChildren<MyDragCamera>(true)[0].RelatedCamera = m_dragIconCamera; obj.name = "EquipmentGrid" + index.ToString(); // var s = m_transDecomposeDialogIconList.GetComponentsInChildren<MogoSingleButtonList>(true)[0] as MogoSingleButtonList; //s.SingleButtonList.Add(obj.GetComponentsInChildren<MogoSingleButton>(true)[0]); obj.GetComponentsInChildren<UILabel>(true)[0].text = BodyName.names[index]; obj.AddComponent<DecomposeUIEquipmentGrid>().id = index; m_listEquipmentGrid.Add(obj); }); } }
private void HookGUI() { //m_distictName = UIView.Find<UITextField>("DistrictName"); Debug.Print("Hooking"); m_panel = (UIPanel)UIView.Find<UITextField>("DistrictName").parent.parent; //m_panel = UIView.Find<UIPanel>("(Library) ZonedBuildingWorldInfoPanel"); Debug.Print (m_panel.cachedName); m_demandSprite = (UISlicedSprite)GameObject.Instantiate(UIView.Find<UISlicedSprite> ("DemandBack")); m_demandSprite.name = "DistrictRCIDemand"; m_demandSprite.cachedName = "DistrictRCIDemand"; m_demandSprite.Show(); m_panel.AttachUIComponent(m_demandSprite.gameObject); m_demandSprite.relativePosition = new Vector3(m_panel.width - m_demandSprite.width - 10f,m_panel.height - m_demandSprite.height - 24f); m_panel.eventVisibilityChanged += (component, value) => {Update();}; //m_panel.eventAnchorChanged += (component, value) => {Update();}; //m_panel.eventPositionChanged += (component, value) => {Update();}; //m_panel.eventMouseMove += (component, value) => {Update();}; UIView.Find<UITextField> ("DistrictName").eventTextChanged += (component, value) => {Update();}; }