Ejemplo n.º 1
0
 private void _Packet(ScPetFeed msg)
 {
     if (msg.response == 0)
     {
         //Logger.LogError(Util.Format("Level = {0} -- exp = {1}", msg.level, msg.exp));
         var pet = GetPet(msg.petId);
         pet.Level = msg.level;
         pet.Exp   = msg.exp;
     }
     DispatchModuleEvent(ResponseFeed, msg);
 }
Ejemplo n.º 2
0
    private void ResponseFeed(ScPetFeed msg)
    {
        if (msg == null)
        {
            return;
        }

        if (msg.response == 0)
        {
            ps.PlayUniformAnimToPreview(parentWindow.SelectPetInfo.GetExpProcess(), 1, Refresh);

            if (curMatrial.ItemCache != null && curMatrial.ItemCache.num > 0)
            {
                var maxLimit = CalcLimitMax();
                if (maxLimit == 0)
                {
                    moduleGlobal.ShowMessage(9707);
                }

                ValueInput.SetLimit(1, (int)Mathf.Min(curMatrial.ItemCache.num, maxLimit));
            }
            else
            {
                ValueInput.SetLimit(0, 0);
            }
            ValueInput.SetValue(0);
            RefreshFeedState();

            var entry = new EffectEntry()
            {
                levelUp = levelUp
            };
            levelUp         = false;
            entry.coroutine = global::Root.instance.StartCoroutine(PlayEffect(entry));
            effectEntryList.Add(entry);
        }
        else
        {
            moduleGlobal.ShowMessage(9702, msg.response);
            Refresh();
        }
    }