Ejemplo n.º 1
0
    void OnChannelConnected(string group_name)
    {
        ChatLine chat = new ChatLine(Localization.Format("ConnectChannel", group_name));

        var line = ChatLinePrefabManager.GetNewObject <PopupChatLine>(ChatLineGrid.transform, Vector3.zero);

        line.Init(chat, null, null);

        if (ChatLineGrid.GetChildList().Count > ChatLineManager.Instance.ChattingMaxLine)
        {
            ChatLinePrefabManager.Free(ChatLineGrid.GetChild(ChatLineGrid.GetChildList().Count - 1).gameObject);
        }

        OnDragFinished(true);
    }
Ejemplo n.º 2
0
    void OnSale(C2G.CreatureSales packet, C2G.CreatureSalesAck ack)
    {
        Network.PlayerInfo.AddGoods(ack.add_goods);
        GameMain.Instance.UpdatePlayerInfo();
        Tooltip.Instance.ShowMessageKeyFormat("SaleCreatureResultFormat", ack.add_goods.goods_value);

        m_SaleSelected.ForEach(c =>
        {
            CreatureManager.Instance.Remove(c.Creature.Idx);
            //m_HeroGrid.RemoveChild(c.transform);
            //c.gameObject.SetActive(false);
            heroItemPrefabManager.Free(c.gameObject);
        });

        m_SaleSelected.Clear();
        UpdateSalePrice(0);
        RefreshInfo();

        CreatureManager.Instance.UpdateNotify();
        m_HeroNotify.gameObject.SetActive(CreatureManager.Instance.IsNotify);

        m_HeroGrid.Reposition();
    }
Ejemplo n.º 3
0
 void OnFinishLevelup(GameObject obj)
 {
     m_LevelupContainer.Free(obj);
 }
Ejemplo n.º 4
0
    public void Init(bool bTweenWeapon = false, bool bTweenArmor = false)
    {
        if (m_Creature.Weapon.Info.Grade == 6 && m_Creature.Weapon.EnchantLevel == 5)
        {
            if (m_Weapon != null)
            {
                if (EquipEnchantPrefab.Contains(m_Weapon.gameObject) == true)
                {
                    EquipEnchantPrefab.Free(m_Weapon.gameObject);
                    m_Weapon = null;
                }
            }
            if (m_Weapon == null)
            {
                m_Weapon = EquipEnchantMaxPrefab.GetNewObject <EquipEnchant>(m_WeaponIndicator.transform, Vector3.zero);
            }
        }
        else
        {
            if (m_Weapon != null)
            {
                if (EquipEnchantMaxPrefab.Contains(m_Weapon.gameObject) == true)
                {
                    EquipEnchantMaxPrefab.Free(m_Weapon.gameObject);
                    m_Weapon = null;
                }
            }
            if (m_Weapon == null)
            {
                m_Weapon = EquipEnchantPrefab.GetNewObject <EquipEnchant>(m_WeaponIndicator.transform, Vector3.zero);
            }
        }

        if (m_Creature.Armor.Info.Grade == 6 && m_Creature.Armor.EnchantLevel == 5)
        {
            if (m_Armor != null)
            {
                if (EquipEnchantPrefab.Contains(m_Armor.gameObject) == true)
                {
                    EquipEnchantPrefab.Free(m_Armor.gameObject);
                    m_Armor = null;
                }
            }
            if (m_Armor == null)
            {
                m_Armor = EquipEnchantMaxPrefab.GetNewObject <EquipEnchant>(m_ArmorIndicator.transform, Vector3.zero);
            }
        }
        else
        {
            if (m_Armor != null)
            {
                if (EquipEnchantMaxPrefab.Contains(m_Armor.gameObject) == true)
                {
                    EquipEnchantMaxPrefab.Free(m_Armor.gameObject);
                    m_Armor = null;
                }
            }
            if (m_Armor == null)
            {
                m_Armor = EquipEnchantPrefab.GetNewObject <EquipEnchant>(m_ArmorIndicator.transform, Vector3.zero);
            }
        }

        m_Weapon.Init(m_Creature.Weapon, OnEnchantCallback, bTweenWeapon);
        m_Armor.Init(m_Creature.Armor, OnEnchantCallback, bTweenArmor);
    }