예제 #1
0
    void OnCreatureOverEnchant(C2G.CreatureOverEnchant packet, C2G.CreatureOverEnchantAck ack)
    {
        EnchantHero enchant_hero = m_Heroes.Find(h => h.Creature == m_OverEnchantMaterial.Creature);

        CreatureManager.Instance.Remove(m_OverEnchantMaterial.Creature.Idx);

        m_Creature.SetEnchant(ack.creature_enchant, 0);
        m_Hero.Init(m_Creature, null, null);

        m_Heroes.Remove(enchant_hero);


        --m_CreatureCount;

        enchant_hero.Init(null);
        enchant_hero.transform.SetParent(null, false);
        enchant_hero.transform.SetParent(m_HeroGrid.transform, false);

        m_HeroGrid.Reposition();

        InitInfo();

        OverEnchantInit();

        Network.PlayerInfo.UseGoodsValue(PacketInfo.pe_GoodsType.token_gold, ack.use_gold);

        GameMain.Instance.UpdatePlayerInfo();

        m_OverEnchantParticleContainer.Play();
        Tooltip.Instance.ShowMessageKey("HeroEnchantSuccess");
    }
예제 #2
0
    void OverEnchantConfirm(bool confirm)
    {
        if (confirm == false)
        {
            return;
        }

        C2G.CreatureOverEnchant packet = new C2G.CreatureOverEnchant();
        packet.creature_idx     = m_Creature.Idx;
        packet.creature_grade   = m_Creature.Grade;
        packet.creature_enchant = m_Creature.Enchant;

        packet.material_idx     = m_OverEnchantMaterial.Creature.Idx;
        packet.material_grade   = m_OverEnchantMaterial.Creature.Grade;
        packet.material_enchant = m_OverEnchantMaterial.Creature.Enchant;

        Network.GameServer.JsonAsync <C2G.CreatureOverEnchant, C2G.CreatureOverEnchantAck>(packet, OnCreatureOverEnchant);
    }