Esempio n. 1
0
    void OnNotifyLootCreatureMessage(H2C.NotifyLootCreature packet)
    {
        ChatLine line = new ChatLine(packet);

        ChatLineManager.Instance.AddLine(line);
        m_ChatLabelCallback(line);
    }
Esempio n. 2
0
    public void InitCharacter(H2C.NotifyLootCreature packet)
    {
        m_CreatureInfo = CreatureInfoManager.Instance.GetInfoByIdn(packet.creature_idn);

        CharacterContainer.Init(AssetManager.GetCharacterAsset(m_CreatureInfo.ID, m_CreatureInfo.GetSkinName(packet.skin_index)), UICharacterContainer.Mode.UI_Normal);
        CharacterContainer.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
        CharacterContainer.SetPlay(UICharacterContainer.ePlayType.Social);

        if (m_CreatureInfo.TeamSkill != null)
        {
            if (m_TeamSkill.atlas.Contains(m_CreatureInfo.TeamSkill.ID) == true)
            {
                m_TeamSkill.spriteName = m_CreatureInfo.TeamSkill.ID;
            }
            else
            {
                m_TeamSkill.spriteName = "skill_default";
            }
            m_TeamSkill.gameObject.transform.parent.parent.gameObject.SetActive(true);
        }
        else
        {
            m_TeamSkill.gameObject.transform.parent.parent.gameObject.SetActive(false);
        }

        for (int i = 0; i < m_Stars.Length; ++i)
        {
            m_Stars[i].SetSpriteActive(packet.creature_grade > i);
            m_Stars[i].gameObject.SetActive(packet.creature_grade > i);
        }

        m_CreatureTitle.text = m_CreatureInfo.Name;

        List <SkillInfo> active_skills = m_CreatureInfo.Skills.Where(s => s.Type == eSkillType.active && s.ActionName.Equals("attack") == false).ToList();

        for (int i = 0; i < m_ActiveSkills.Length; ++i)
        {
            bool active = i < active_skills.Count;
            m_ActiveSkills[i].gameObject.SetActive(active);
            if (active)
            {
                m_ActiveSkills[i].Init(active_skills[i]);
            }
        }

        List <SkillInfo> passive_skills = m_CreatureInfo.Skills.Where(s => s.Type == eSkillType.passive).ToList();

        for (int i = 0; i < m_PassiveSkills.Length; ++i)
        {
            bool active = i < passive_skills.Count;
            m_PassiveSkills[i].gameObject.SetActive(active);
            if (active)
            {
                m_PassiveSkills[i].Init(passive_skills[i]);
            }
        }

        m_StarGrid.Reposition();
    }
Esempio n. 3
0
    public ChatLine(H2C.NotifyLootCreature loot_creature)
    {
        Msg = Localization.Format(string.Format("{0}{1}", "TakeWhere", loot_creature.take_where), loot_creature.nickname, loot_creature.creature_grade, CreatureInfoManager.Instance.GetInfoByIdn(loot_creature.creature_idn).Name);

        LineType   = pe_MsgType.Item;
        AccountIdx = loot_creature.account_idx;

        RecvAt   = Network.Instance.ServerTime;
        HubType  = pe_HubType.SmallHeroChat;
        Level    = loot_creature.level;
        Nickname = loot_creature.nickname;

        LootCreature = loot_creature;
    }
Esempio n. 4
0
 public override void Init(params object[] parms)
 {
     H2C.NotifyLootCreature creature = parms[0] as H2C.NotifyLootCreature;
     InitCharacter(creature);
 }