コード例 #1
0
 /// <summary>
 /// 操作返回
 /// </summary>
 public void OperationBack(MsgTalentOperation msg)
 {
     if (msg.M_TalentCode == TalentCode.UpLevel)
     {
         Debug.Log("dddddddd" + msg.Tid);
         if (m_TalentProxy.GetTalentVODic().TryGetValue(msg.Tid, out TalentVO talentVO))
         {
             talentVO.MTalentElement.PlayUpLevel();
         }
     }
 }
コード例 #2
0
    /// <summary>
    /// 发送操作指令
    /// </summary>
    /// <param name="code">指令</param>
    /// <param name="tid">tid</param>
    public async void GetTalentOperation(TalentCode code, ulong tid)
    {
        Debug.Log(tid + "------->>>>>发送操作天赋指令" + code);
        TalentOperationResponse getTalentInfosResponse = await TalentOperationRPC.TalentOperation((uint)code, tid);

        Debug.Log("------->>>>>接收操作天赋" + getTalentInfosResponse.Success);
        if (code == TalentCode.Reset || code == TalentCode.StopUse)
        {
            ResetLevelData((uint)tid);
        }
        if (getTalentInfosResponse.Success != null && getTalentInfosResponse.Success.Success_.ErrorCode == 0)
        {
            m_TalentNodes.Clear();
            m_TalentNodes = getTalentInfosResponse.Success.Success_.Nodes;
            int errorCode = getTalentInfosResponse.Success.Success_.ErrorCode;
            DebugErrorCode(errorCode);
            for (int i = 0; i < m_TalentNodes.Count; i++)
            {
                TalentVO talentVO = null;
                if (m_TalentVODic.TryGetValue(m_TalentNodes[i].Tid, out talentVO))
                {
                    talentVO.Level    = (int)m_TalentNodes[i].Level;
                    talentVO.Type     = (int)m_TalentNodes[i].Type;
                    talentVO.MaxLevel = (int)m_TalentNodes[i].Maxlevel;
                    SetTalentState(talentVO);
                }
                else
                {
                    Debug.Log("本地没有这个数据");
                }
            }
        }
        else
        {
            Debug.Log("没有数据");
        }
        MsgTalentOperation msgTalentOperation = new MsgTalentOperation();

        msgTalentOperation.M_TalentCode = code;
        msgTalentOperation.Tid          = (uint)tid;
        if (getTalentInfosResponse.Success.Success_.ErrorCode == 0)
        {
            GameFacade.Instance.SendNotification(NotificationName.MSG_TALENT_OPERATION, msgTalentOperation);
        }
    }