private void DoSelect() { if (ItemType == 1) { if (MyHead.toggle.value && m_CanLevUP == false && m_CanStarUP == false && UserDC.GetLevel() < m_caption.m_levelneed) { NGUIUtil.ShowTipWndByKey(10000156); return; } if (MyHead.toggle.value) { m_parent.Select(m_caption.m_captionid); } } else if (ItemType == 0) { if (m_iHave < m_iNeed) { NGUIUtil.ShowTipWndByKey(30000061); } else { m_parent.CurSummonCaptianID = m_caption.m_captionid; BlackScienceDC.SendCaptainActivateRequest(m_caption.m_captionid); } } }
/// <summary> /// 检测船长技能是否存在,没有则隐藏 /// </summary> void CheckCaptionCount() { if (BlackScienceDC.CheckHaveCaption() == false) { // MyHead.BtnBlackScience.transform.parent.gameObject.SetActive(false); MyHead.SprCaptainHead.gameObject.SetActive(false); } }
/// <summary> /// 清理数据中心数据 /// </summary> public static void ClearDC() { UserDC.ClearDC(); SoldierDC.ClearDC(); BuildDC.ClearDC(); ItemDC.ClearDC(); BlackScienceDC.ClearDC(); ShipPlanDC.ClearDC(); }
/// <summary> /// 模拟数据接口。 /// </summary> public static void SimulationData() { UserDC.SimulationData(); SoldierDC.SimulationData(); StageDC.SimulationData(); BuildDC.SimulationData(); BlackScienceDC.SimulationData(); ShipPlanDC.SimulationData(); }
public int m_CaptainID; //船长ID public CaptainSkillInfo(int CaptainID, LifeMCamp Camp, int mana) { m_CaptainID = CaptainID; CaptionInfo God = BlackScienceDC.GetCaption(CaptainID); m_Skill.SetSkill(God.GetGodSkillInfo()); m_Skill.Camp = Camp; m_Mana = mana; }
public void SetCaption(int id) { m_iCurCaptainID = id; CaptionInfo c = BlackScienceDC.GetCaption(id); ShipPlan P = ShipPlanDC.GetCurShipPlan(); P.BlackScienceID = c.m_id; SetBlackScienceUI(c); }
/// <summary> /// 是否有技能可以升星升级. /// </summary> public static bool CheckCanUp() { foreach (CaptionInfo info in m_Captions.Values) { if (BlackScienceDC.CheckLevUp(info) || BlackScienceDC.CheckStarUp(info)) { return(true); } } return(false); }
/// <summary> /// 黑科技 /// </summary> void BtnBlackScience_OnClickEventHandler(UIButton sender) { if (BlackScienceDC.CheckHaveCaption() == false) { NGUIUtil.ShowTipWndByKey(30000050); return; } BlackScienceChoWnd bsWnd = WndManager.GetDialog <BlackScienceChoWnd>(); ShipPlan P = ShipPlanDC.GetCurShipPlan(); CaptionInfo captionInfo = BlackScienceDC.GetCaptionD(P.BlackScienceID); bsWnd.SetSelectCaptain(captionInfo); }
public override void WndStart() { base.WndStart(); MyHead.BtnBackground.OnClickEventHandler += BtnBackground_OnClickEventHandler; MyHead.BtnNO.OnClickEventHandler += BtnBackground_OnClickEventHandler; MyHead.BtnYes.OnClickEventHandler += BtnYes_OnClickEventHandler; List <CaptionInfo> caplist = new List <CaptionInfo>(); BlackScienceDC.GetCaptions(ref caplist, UserDC.GetLevel()); LoadCapHeadList(caplist, MyHead.Parent); WndEffects.DoWndEffect(gameObject); }
void RefreshBlackScienceUI() { ShipPlan P = ShipPlanDC.GetCurShipPlan(); CaptionInfo captionInfo = BlackScienceDC.GetCaptionD(P.BlackScienceID); if (captionInfo != null) { SetBlackScienceUI(captionInfo); } else //未设置黑科技 { NGUIUtil.Set2DSprite(MyHead.SprCaptainHead, "Textures/role/", "-999"); NGUIUtil.SetLableText <string>(MyHead.LblSkillName, ""); } }
// 传的是数据表里的ID public void SetBlackScienceDataID(int id) { CaptionInfo c = BlackScienceDC.GetCaptionD(id); m_SelectedBlackScienceDataID = id; m_SelectedBlackScienceCaptainID = c.m_captionid; if (c != null) { NGUIUtil.Set2DSprite(MyHead.SprCaptainHead, "Textures/role/", c.m_captionid.ToString()); } else { NGUIUtil.DebugLog("BlackScienceID = " + id + " 未设置"); } }
public void RefreshUI() { U3DUtil.DestroyAllChild(MyHead.SelectCaptionTable.gameObject); m_CaptionList.Clear(); SetUserData(); MyHead.UpStar.SetActive(false); //加载已拥有黑科技 List <CaptionInfo> caplist = new List <CaptionInfo>(); BlackScienceDC.GetExistBS(ref caplist); LoadCapHeadList(caplist, MyHead.SelectCaptionTable); //加载未召唤黑科技 List <CaptionInfo> caplist1 = new List <CaptionInfo>(); BlackScienceDC.GetHaveFragmentBS(ref caplist1); LoadCapHeadList(caplist1, MyHead.SelectCaptionTable, 0); }
void Up(UIButton sender) { if (MyHead.togUpLevel.value) { if (m_CurItem.m_CanLevUP) { DataCenter.RegisterHooks((int)gate.Command.CMD.CMD_1102, CMD_1102); BlackScienceDC.Send_CAPTAIN_LEVEL_UP(m_CurItem.m_caption.m_id); } else { if (UserDC.GetCoin() < m_CurItem.Godskill.m_coinneed) { NGUIUtil.ShowTipWndByKey("60000021", 2.0f); } else if (UserDC.GetCrystal() < m_CurItem.Godskill.m_crystalneed) { NGUIUtil.ShowTipWndByKey("60000023", 2.0f); } else if (UserDC.GetLevel() < m_CurItem.m_caption.m_levelneed) { NGUIUtil.ShowTipWndByKey("60000027", 2.0f); } } } else { if (m_CurItem.m_CanStarUP) { DataCenter.RegisterHooks((int)gate.Command.CMD.CMD_1106, CMD_1106); BlackScienceDC.Send_CAPTAIN_STAR_UP(m_CurItem.m_caption.m_id); } else { NGUIUtil.ShowTipWndByKey("60000024", 2.0f); } } }
public override void WndStart() { base.WndStart(); MyHead.BtnRelease.gameObject.SetActive(true); ChangeBiaoqing((int)CaptionExpress.idle, true); m_currentstate = GodSkillState.Idle; if (MyHead.BtnRelease) { MyHead.BtnRelease.OnPressDownEventHandler += BtnRelease_OnClickEventHandler; } m_captioninfo = BlackScienceDC.GetCaption(CmCarbon.GetCaptainID(true)); MyHead.lblLevel.text = m_captioninfo.m_level1.ToString(); NGUIUtil.Set2DSprite(MyHead.m_BiaoQingParent, "Textures/role/", m_captioninfo.m_captionid.ToString()); UISprite[] starSprites = U3DUtil.GetComponentsInChildren <UISprite>(MyHead.StarListParent); //NGUIUtil.SetStarLevelNum (starSprites,m_captioninfo.m_star); for (int i = 0; i < starSprites.Length; i++) { if (i >= m_captioninfo.m_star) { starSprites[i].gameObject.SetActive(false); } } UIGrid grid = MyHead.StarListParent.GetComponent <UIGrid>(); grid.Reposition(); if (m_captioninfo.GetGodSkillInfo().m_power2 > 0) { MyHead.LblDestroyPts.text = m_captioninfo.GetGodSkillInfo().m_power2.ToString(); } else { MyHead.LblDestroyPts.transform.parent.gameObject.SetActive(false); } }
private void CheckLevUp() { m_CanLevUP = BlackScienceDC.CheckLevUp(m_caption); }
public static bool ProcessData(int CmdID, object Para) { bool bResult = true; if (Para is gate.GateMessage.MessageContent) { gate.GateMessage.MessageContent msg = Para as gate.GateMessage.MessageContent; int nErrorCode = 0; gate.ErrorMessage emsg = msg.error_message; if (emsg != null) { if (emsg.code > 0) { FileLog.ProtocolDump(emsg); nErrorCode = emsg.code; NGUIUtil.DebugLog(string.Format("CmdID={0},errorCode={1},description={2}", CmdID, emsg.code, emsg.description)); bResult = false; //return false; //如取名重名也会返回error_message.code>0,所以这里不宜return,否则客户端hook代码不会执行 } } object data = null; if (bResult && msg.network_message != null) //如果失败了,有可能msg.network_message为null { data = protobufM.Deserialize(msg.proto_name, msg.network_message); } //dump FileLog.ProtocolDumpwrite(CmdID.ToString()); FileLog.ProtocolDumpwriteXml(CmdID.ToString()); if (CmdID != 9999) { FileLog.ProtocolDump(data); } //统一在外围直接解析,不到具体的DC去 if (bResult == true) { int DcBlock = CmdID / 100; switch (DcBlock) { case 2: bResult = SoldierDC.ProcessData(CmdID, nErrorCode, data); break; case 5: bResult = ShipPlanDC.ProcessData(CmdID, nErrorCode, data); break; case 6: bResult = UserDC.ProcessData(CmdID, nErrorCode, data); break; case 7: bResult = StageDC.ProcessData(CmdID, nErrorCode, data); break; case 8: bResult = ItemDC.ProcessData(CmdID, nErrorCode, data); break; case 9: bResult = BuildDC.ProcessData(CmdID, nErrorCode, data); break; case 11: bResult = BlackScienceDC.ProcessData(CmdID, nErrorCode, data); break; } } ProcessRealHooks(CmdID, nErrorCode); } return(bResult); }
private void CheckStarUp() { m_CanStarUP = BlackScienceDC.CheckStarUp(m_caption); }