void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); m_tranUIGridlList = FindTransform("EnergyNoEnoughUIGridList"); m_gridListCamera = FindTransform("EnergyNoEnoughUIGridListCamera").GetComponentsInChildren<Camera>(true)[0]; m_camInitPos = m_gridListCamera.transform.localPosition; m_dragableCamera = m_gridListCamera.GetComponentsInChildren<MyDragableCamera>(true)[0]; m_dragableCamera.LeftArrow = FindTransform("EnergyNoEnoughUIArrowUp").gameObject; m_dragableCamera.RightArrow = FindTransform("EnergyNoEnoughUIArrowDown").gameObject; m_lblEnergyNoEnoughUIProgressBarText = FindTransform("EnergyNoEnoughUIProgressBarText").GetComponentsInChildren<UILabel>(true)[0]; m_lblEnergyNoEnoughUITipText = FindTransform("EnergyNoEnoughUITipText").GetComponentsInChildren<UILabel>(true)[0]; SetEnergyRecover(); m_goEnergyNoEnoughUIProgressBar = FindTransform("EnergyNoEnoughUIProgressBar").gameObject; m_chooseWayMogoSingleButtonList = FindTransform("EnergyNoEnoughUIChooseWay").GetComponentsInChildren<MogoSingleButtonList>(true)[0]; FindTransform("EnergyNoEnoughUIBtnClose").gameObject.AddComponent<EnergyNoEnoughUIButton>(); FindTransform("ChooseWay1").gameObject.AddComponent<EnergyNoEnoughUIButton>(); FindTransform("ChooseWay2").gameObject.AddComponent<EnergyNoEnoughUIButton>(); FindTransform("ChooseWay3").gameObject.AddComponent<EnergyNoEnoughUIButton>(); m_tabTitleLabelList[0] = FindTransform("ChooseWay1TextTitle").GetComponentsInChildren<UILabel>(true)[0]; m_tabTitleLabelList[1] = FindTransform("ChooseWay2TextTitle").GetComponentsInChildren<UILabel>(true)[0]; m_tabTitleLabelList[2] = FindTransform("ChooseWay3TextTitle").GetComponentsInChildren<UILabel>(true)[0]; m_tabDescLabelList[0] = FindTransform("ChooseWay1TextDesc").GetComponentsInChildren<UILabel>(true)[0]; m_tabDescLabelList[1] = FindTransform("ChooseWay2TextDesc").GetComponentsInChildren<UILabel>(true)[0]; m_tabDescLabelList[2] = FindTransform("ChooseWay3TextDesc").GetComponentsInChildren<UILabel>(true)[0]; for (int i = 0; i <= 2; i++) { EnergyNoEnoughUITabUp(i); } CurrentDownTab = (int)EnergyNoEnoughUITab.BuyEnergyTab; Initialize(); }
void Awake() { m_instance = this; m_myTransform = transform; FillFullNameData(m_myTransform); m_tranUIGridlList = FindTransform("EnergyNoEnoughUIGridList"); m_gridListCamera = FindTransform("EnergyNoEnoughUIGridListCamera").GetComponentsInChildren <Camera>(true)[0]; m_camInitPos = m_gridListCamera.transform.localPosition; m_dragableCamera = m_gridListCamera.GetComponentsInChildren <MyDragableCamera>(true)[0]; m_dragableCamera.LeftArrow = FindTransform("EnergyNoEnoughUIArrowUp").gameObject; m_dragableCamera.RightArrow = FindTransform("EnergyNoEnoughUIArrowDown").gameObject; m_lblEnergyNoEnoughUIProgressBarText = FindTransform("EnergyNoEnoughUIProgressBarText").GetComponentsInChildren <UILabel>(true)[0]; m_lblEnergyNoEnoughUITipText = FindTransform("EnergyNoEnoughUITipText").GetComponentsInChildren <UILabel>(true)[0]; SetEnergyRecover(); m_goEnergyNoEnoughUIProgressBar = FindTransform("EnergyNoEnoughUIProgressBar").gameObject; m_chooseWayMogoSingleButtonList = FindTransform("EnergyNoEnoughUIChooseWay").GetComponentsInChildren <MogoSingleButtonList>(true)[0]; FindTransform("EnergyNoEnoughUIBtnClose").gameObject.AddComponent <EnergyNoEnoughUIButton>(); FindTransform("ChooseWay1").gameObject.AddComponent <EnergyNoEnoughUIButton>(); FindTransform("ChooseWay2").gameObject.AddComponent <EnergyNoEnoughUIButton>(); FindTransform("ChooseWay3").gameObject.AddComponent <EnergyNoEnoughUIButton>(); m_tabTitleLabelList[0] = FindTransform("ChooseWay1TextTitle").GetComponentsInChildren <UILabel>(true)[0]; m_tabTitleLabelList[1] = FindTransform("ChooseWay2TextTitle").GetComponentsInChildren <UILabel>(true)[0]; m_tabTitleLabelList[2] = FindTransform("ChooseWay3TextTitle").GetComponentsInChildren <UILabel>(true)[0]; m_tabDescLabelList[0] = FindTransform("ChooseWay1TextDesc").GetComponentsInChildren <UILabel>(true)[0]; m_tabDescLabelList[1] = FindTransform("ChooseWay2TextDesc").GetComponentsInChildren <UILabel>(true)[0]; m_tabDescLabelList[2] = FindTransform("ChooseWay3TextDesc").GetComponentsInChildren <UILabel>(true)[0]; for (int i = 0; i <= 2; i++) { EnergyNoEnoughUITabUp(i); } CurrentDownTab = (int)EnergyNoEnoughUITab.BuyEnergyTab; Initialize(); }