Пример #1
0
    public void SetBossCopyItemInfo(st.net.NetBase.boss_copy_list bossInfo)
    {
        string name   = string.Empty;
        string levStr = string.Empty;

        if (bossInfo != null)
        {
            MonsterRef mob = ConfigMng.Instance.GetMonsterRef((int)bossInfo.boss_id);
            if (mob != null)
            {
                name   = mob.name;
                levStr = "Lv." + mob.lv;
            }
        }
        if (nameLabel != null)
        {
            nameLabel.text = name;
        }
        if (levelLabel != null)
        {
            levelLabel.text = levStr;
        }
        if (labAppear != null)
        {
            labAppear.enabled = (bossInfo.boss_kill_state == 2);
        }
        if (labKilled != null)
        {
            labKilled.enabled = (bossInfo.boss_kill_state == 1);
        }
    }
Пример #2
0
 void OnClickMoveToMobBtn(GameObject go)
 {
     GameCenter.curMainPlayer.commandMng.CancelCommands();
     st.net.NetBase.boss_copy_list info = UIEventListener.Get(go).parameter as st.net.NetBase.boss_copy_list;
     if (info != null)
     {
         BossRef mob = ConfigMng.Instance.GetBossRefByID((int)info.boss_id);
         if (mob != null)
         {
             GameCenter.curMainPlayer.GoTraceTarget(mob.sceneID, mob.sceneX, mob.sceneY);
         }
     }
 }
Пример #3
0
    public override byte[] toBinary()
    {
        writer = new st.net.NetBase.ByteWriter();
        writer.write_int(boss_surplus_num);
        writer.write_int(add_property);
        ushort lenboss_list = (ushort)boss_list.Count;

        writer.write_short(lenboss_list);
        for (int i_boss_list = 0; i_boss_list < lenboss_list; i_boss_list++)
        {
            st.net.NetBase.boss_copy_list listData = boss_list[i_boss_list];
            listData.toBinary(writer);
        }
        return(writer.data);
    }
Пример #4
0
    public override void fromBinary(byte[] binary)
    {
        reader           = new st.net.NetBase.ByteReader(binary);
        boss_surplus_num = reader.Read_int();
        add_property     = reader.Read_int();
        ushort lenboss_list = reader.Read_ushort();

        boss_list = new List <st.net.NetBase.boss_copy_list>();
        for (int i_boss_list = 0; i_boss_list < lenboss_list; i_boss_list++)
        {
            st.net.NetBase.boss_copy_list listData = new st.net.NetBase.boss_copy_list();
            listData.fromBinary(reader);
            boss_list.Add(listData);
        }
    }
Пример #5
0
    void Refresh()
    {
        for (int i = 0; i < bossList.Count; i++)
        {
            bossList[i].gameObject.SetActive(false);
        }
        List <st.net.NetBase.boss_copy_list> bossCopyList = GameCenter.bossChallengeMng.bossList;
        int index = 0;

        for (int i = 0, max = bossCopyList.Count; i < max; i++)
        {
            st.net.NetBase.boss_copy_list item = bossCopyList[i];
            if (bossList.Count < index + 1)
            {
                bossList.Add(bossSingle.CreateNew(grid.transform, index));
            }
            bossList[index].gameObject.SetActive(true);
            bossList[index].SetBossCopyItemInfo(item);
            UIEventListener.Get(bossList[index].gameObject).onClick  -= OnClickMoveToMobBtn;
            UIEventListener.Get(bossList[index].gameObject).onClick  += OnClickMoveToMobBtn;
            UIEventListener.Get(bossList[index].gameObject).parameter = item;
            index++;
        }
        if (labAddAttrNum != null)
        {
            labAddAttrNum.text = (GameCenter.bossChallengeMng.CurBossCoppyAttrNum * 10).ToString();                     // +"%";
        }
        if (remainBossNum != null)
        {
            remainBossNum.text = GameCenter.bossChallengeMng.RemainBossCount.ToString();
        }
        if (btnAddAttr != null)
        {
            btnAddAttr.SetActive(GameCenter.bossChallengeMng.CurBossCoppyAttrNum != 10);
        }
        if (maxAttrGo != null)
        {
            maxAttrGo.SetActive(GameCenter.bossChallengeMng.CurBossCoppyAttrNum == 10);
        }
    }