コード例 #1
0
    /// <summary>
    /// 获取已解锁宝箱id
    /// </summary>
    public static void GetUnlockTreasureChestID()
    {
        CSEmptyWarehouseUnlockInfo cSEmptyWarehouseUnlockInfo = new CSEmptyWarehouseUnlockInfo();

        ProtocalManager.Instance().SendCSEmptyWarehouseUnlockInfo(cSEmptyWarehouseUnlockInfo, (errorInfo) =>
        {
            if (errorInfo != null && errorInfo.UnlockInfo != null)
            {
                Dictionary <int, long> ids = new Dictionary <int, long>();
                for (int i = 0; i < errorInfo.UnlockInfo.Count; i++)
                {
                    //ids.Add(errorInfo.UnlockInfo[i].BoxId, errorInfo.UnlockInfo[i].UnlockTime);
                    if (_unlockTreasureChestIds.ContainsKey(errorInfo.UnlockInfo[i].BoxId))
                    {
                        _unlockTreasureChestIds[errorInfo.UnlockInfo[i].BoxId] = errorInfo.UnlockInfo[i].UnlockTime;
                    }
                    else
                    {
                        _unlockTreasureChestIds.Add(errorInfo.UnlockInfo[i].BoxId, errorInfo.UnlockInfo[i].UnlockTime);
                    }
                }
                WarehouseController.Instance.RefreshData();
            }
            Debug.Log("成功获取已经解锁宝箱id");
        }, (errorInfo) =>
        {
            Debug.Log("获取已解锁宝箱id失败");
        });
    }
コード例 #2
0
        public void SendCSEmptyWarehouseUnlockInfo(CSEmptyWarehouseUnlockInfo csemptywarehouseunlockinfo, Action <SCTreasureChestUnlockInfo> ResponseSCTreasureChestUnlockInfoCallBack, Action <ErrorInfo> errorCallBack, bool isShowDefaultTip = true)
        {
            OpCodeType opCodeType = ListOPRelation.GetOpCodeTypeByRequest <CSEmptyWarehouseUnlockInfo> ();

            ProtoSendMethod.BusinessRequest <SCTreasureChestUnlockInfo>(csemptywarehouseunlockinfo, opCodeType, ResponseSCTreasureChestUnlockInfoCallBack, errorCallBack, isShowDefaultTip);
        }