protected override void InitOnceInfo() { base.InitOnceInfo(); RegisterListeners(); m_WeaponNode = GetComponentInChildren <WeaponNode>(); m_WeaponNode.Init(this); //m_SubWeaponNode = GetComponentInChildren<SubWeaponNode>(); //m_SubWeaponNode.Init(this); //m_PetNode = GetComponentInChildren<PetNode>(); //m_PetNode.Init(this); GeneralConfigItem gci = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.WEAPON_OPEN_PASS); m_OpenLevels = new int[gci.contents.Length]; for (int i = 0; i < gci.contents.Length; i++) { m_OpenLevels[i] = int.Parse(gci.contents[i]); } InitNode(); }
public void Init(ItemItem itemConfig, int showOrder, WeaponNode parent) { gameObject.SetActive(true); m_Parent = parent; AskBg.gameObject.SetActive(false); AskIcon.gameObject.SetActive(false); AskTxt.gameObject.SetActive(false); Item.gameObject.SetActive(true); m_ItemConfig = itemConfig; transform.SetSiblingIndex(1 * (showOrder * 10000 + m_ItemConfig.showorder)); GeneralConfigItem gCfg = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.ASK_WEAPON_OPEN_PASS); if (gCfg != null) { int id = int.Parse(gCfg.contents[0]); int openPass = int.Parse(gCfg.contents[1]); if (m_ItemConfig.id == id && Global.gApp.gSystemMgr.GetPassMgr().GetPassSerial() <= openPass) { Item.gameObject.SetActive(false); AskBg.gameObject.SetActive(true); AskIcon.gameObject.SetActive(true); AskTxt.gameObject.SetActive(true); AskTxt.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(3106); return; } } UIFresh(); Deal4Level(m_ItemConfig); NewbieGuideButton[] newBieButtons = this.GetComponentsInChildren <NewbieGuideButton>(); foreach (NewbieGuideButton newBieButton in newBieButtons) { newBieButton.Param = m_WeaponName; newBieButton.OnStart(); } }