public static void OpenUI(Building buildData) { if (_mInstance == null) { UnityEngine.Object prefab = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UISourceBuildingPanel); if (prefab != null) { GameObject obj = Instantiate(prefab) as GameObject; RED.AddChild(obj, DBUIController.mDBUIInstance._TopRoot); _mInstance = obj.GetComponent <UISourceBuilding> (); _mInstance.m_data = buildData; _mInstance.InitUI(); RED.TweenShowDialog(obj); } } else { _mInstance.SetShow(true); _mInstance.m_data = buildData; _mInstance.InitUI(); } }
public void ClickBuild() { if (Core.Data.playerManager.RTData.curLevel < m_buildData.config.limitLevel && m_buildData.config.limitLevel >= 0) { string strText = Core.Data.stringManager.getString(6054); strText = strText.Replace("#", m_buildData.config.limitLevel.ToString()); SQYAlertViewMove.CreateAlertViewMove(strText); return; } if (m_buildData.config.build_kind == BaseBuildingData.BUILD_KIND_PRODUCE) { if (m_buildData.RTData.openType != 0 && m_buildData.RTData.robc > 0 && !m_bRobTipOpened) { ShowRobUI(); return; } } if (m_buildData.config.id == BaseBuildingData.BUILD_ZHAOMU) { if (Core.Data.BuildingManager.ZhaoMuUnlock) { ZhaoMuUI.OpenUI(); DBUIController.mDBUIInstance.HiddenFor3D_UI(); } else { string strText = Core.Data.stringManager.getString(9111); strText = string.Format(strText, RED.GetChineseNum(4)); SQYAlertViewMove.CreateAlertViewMove(strText); } } else if (m_buildData.config.id == BaseBuildingData.BUILD_XUNLIAN) { TrainingRoomUI.OpenUI(); DBUIController.mDBUIInstance.HiddenFor3D_UI(); } else if (m_buildData.config.id == BaseBuildingData.BUILD_YELIAN) { FrogingSystem.ForgingRoomUI.OpenUI(); DBUIController.mDBUIInstance.HiddenFor3D_UI(); } else if (m_buildData.config.id == BaseBuildingData.BUILD_TREE) { string strText = Core.Data.stringManager.getString(5116); SQYAlertViewMove.CreateAlertViewMove(strText); return; } else if (m_buildData.config.id == BaseBuildingData.BUILD_SHOP) { SecretShopMgr.GetInstance().SetSecretShop(true, 1); DBUIController.mDBUIInstance.HiddenFor3D_UI(); } else if (m_buildData.config.id == BaseBuildingData.Q_phD) { SecretShopMgr.GetInstance().SetSecretShop(true, 2); DBUIController.mDBUIInstance.HiddenFor3D_UI(); } else if (m_buildData.config.id == BaseBuildingData.BUILD_MailBox) { MailBox.OpenUI(1); DBUIController.mDBUIInstance.HiddenFor3D_UI(); } else if (m_buildData.config.id == BaseBuildingData.BUILD_FUBEN) { DBUIController.mDBUIInstance.OnBtnMainViewID(SQYMainController.CLICK_FuBen); } else if (m_buildData.config.id == BaseBuildingData.BUILD_CHALLENGE) { DBUIController.mDBUIInstance.OnBtnMainViewID(SQYMainController.CLICK_DuoBao); } else if (m_buildData.config.id == BaseBuildingData.BUILD_FRAGMENT) { DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, RUIType.EMBoxType.LOOK_MonFrag); } else if (m_buildData.config.build_kind == BaseBuildingData.BUILD_KIND_PRODUCE) { Debug.Log(" build_kind " + m_buildData.config.build_kind); UISourceBuilding.OpenUI(m_buildData); } else { BuildingLvUpNew.OpenUI(m_buildData); //BuildLvlUpUI.OpenUI(m_buildData); } }
public void Awake() { _mInstance = this; }