Пример #1
0
    /// <summary>
    /// 接收签到数据
    /// </summary>
    /// <param name="res"></param>
    private void OnSignRes(byte[] res)
    {
        SignInRes  response = ProtoBufUtils.Deserialize <SignInRes>(res);
        GameObject today    = signs[TimeSystem.GetCurrentDay - 1];
        GameObject signed   = ResourceMgr.CreateUIPrefab("GUIs/SignIn/siged", today.transform);

        signed.transform.localScale = Vector3.one * 2;
        Tweener tween = signed.transform.DOScale(Vector3.one, 1);
    }
Пример #2
0
        private void OnActivitySignInHandler(SignInRes res)
        {
            Debug.Log("OnActivitySignInHandler");
            foreach (var v in res.Awards)
            {
                //   Debug.LogError(v.Num + " " + v.ResourceId + "" + v.Resource);
                switch (v.Resource)
                {
                case ResourcePB.Card:
                    GlobalData.CardModel.UpdateUserCardsByIdAndNum(v.ResourceId, v.Num);
                    break;

                case ResourcePB.Item:
                    GlobalData.PropModel.AddProp(v);
                    break;

                case ResourcePB.Puzzle:    //更新碎片
                    //策划说不会送碎片   所以不做
                    break;

                case ResourcePB.Power:
                    GlobalData.PlayerModel.AddPower(v.Num);
                    break;

                case ResourcePB.Gem:
                    GlobalData.PlayerModel.UpdateUserGem(v.Num);
                    break;

                case ResourcePB.Gold:
                    GlobalData.PlayerModel.UpdateUserGold(v.Num);
                    break;

                case ResourcePB.Fans:
                    GlobalData.DepartmentData.UpdateFans(v.ResourceId, v.Num);
                    break;

                case ResourcePB.Memories:
                    GlobalData.PlayerModel.AddRecollectionEnergy(v.Num);
                    break;
                }
            }
        }