Exemple #1
0
 private HeadInfoControl GetControl(long uuid)
 {
     for (int i = 0; i < this.m_controls.get_Count(); i++)
     {
         HeadInfoControl headInfoControl = this.m_controls.get_Item(i);
         if (headInfoControl.uuid == uuid)
         {
             return(headInfoControl);
         }
     }
     return(null);
 }
Exemple #2
0
    private HeadInfoControl AddControl(Transform parent, float height, long uuid, Transform ui, int actorType, bool avc_control)
    {
        Transform       transform       = BillboardManager.AddHeadInfoPosition(parent, height);
        HeadInfoControl headInfoControl = transform.get_gameObject().AddMissingComponent <HeadInfoControl>();

        headInfoControl.uuid         = uuid;
        headInfoControl.m_isInAVC    = avc_control;
        headInfoControl.m_headInfoUI = ui;
        headInfoControl.m_actorType  = actorType;
        headInfoControl.set_enabled(true);
        this.m_controls.Add(headInfoControl);
        return(headInfoControl);
    }
Exemple #3
0
    private void ResortOfZ2D()
    {
        if (CamerasMgr.CameraMain == null || !CamerasMgr.CameraMain.get_enabled())
        {
            return;
        }
        if (CamerasMgr.CameraUI == null || !CamerasMgr.CameraUI.get_enabled())
        {
            return;
        }
        if (this.m_controls.get_Count() <= 1)
        {
            return;
        }
        Utils.RemoveNull <HeadInfoControl>(this.m_controls);
        this.m_controls.Sort((HeadInfoControl a, HeadInfoControl b) => CamerasMgr.CameraUI.ScreenToViewportPoint(CamerasMgr.CameraMain.WorldToScreenPoint(b.get_transform().get_position())).z.CompareTo(CamerasMgr.CameraUI.ScreenToViewportPoint(CamerasMgr.CameraMain.WorldToScreenPoint(a.get_transform().get_position())).z));
        HeadInfoManager.IsUpdateLockOn = true;
        int num = 0;

        while (num < this.m_controls.get_Count() && num < this.m_uis.get_Count())
        {
            HeadInfoControl headInfoControl   = this.m_controls.get_Item(num);
            HeadInfoUnit    headInfoUnit      = this.m_uis.get_Item(num);
            HeadInfoManager.HeadInfoData data = this.GetData(headInfoControl.uuid);
            if (data != null)
            {
                if (headInfoControl != null && headInfoUnit != null)
                {
                    headInfoUnit.uuid            = data.uuid;
                    headInfoUnit.actorType       = data.actorType;
                    headInfoControl.m_headInfoUI = headInfoUnit.get_transform();
                    headInfoControl.m_actorType  = data.actorType;
                    HeadInfoControl control = this.GetControl(data.uuid);
                    if (control != null)
                    {
                        control.UpdatePos();
                    }
                }
            }
            num++;
        }
        HeadInfoManager.IsUpdateLockOn = false;
        for (int i = 0; i < this.m_uis.get_Count(); i++)
        {
            HeadInfoUnit headInfoUnit2 = this.m_uis.get_Item(i);
            if (headInfoUnit2 != null)
            {
                headInfoUnit2.RefreshAll();
            }
        }
    }
Exemple #4
0
    private void UpdateShow(HeadInfoManager.HeadInfoData data, HeadInfoUnit ui)
    {
        if (data == null || ui == null)
        {
            return;
        }
        ui.ShowName(data.Show(data.isShowName));
        ui.SetAndShowTitle(data.Show(data.isShowTitle), data.titleId);
        ui.SetAndShowGuildTitle(data.Show(data.isShowGuildTitle), data.guildTitle);
        ui.ShowCommonIcon(data.Show(data.isShowCommonIcon), data.commonIcon);
        ui.SetAndShowBloodBar(data.ShowBloodBar(false), data.bloodBarType);
        HeadInfoControl control = this.GetControl(data.uuid);

        if (control != null)
        {
            control.UpdatePos();
        }
    }
Exemple #5
0
 public void RemoveHeadInfo(long uuid)
 {
     for (int i = 0; i < this.m_datas.get_Count(); i++)
     {
         HeadInfoManager.HeadInfoData headInfoData = this.m_datas.get_Item(i);
         if (headInfoData.uuid == uuid)
         {
             this.m_datas.RemoveAt(i);
             break;
         }
     }
     for (int j = 0; j < this.m_uis.get_Count(); j++)
     {
         HeadInfoUnit headInfoUnit = this.m_uis.get_Item(j);
         if (!(headInfoUnit == null))
         {
             if (headInfoUnit.uuid == uuid)
             {
                 headInfoUnit.ResetAll();
                 HeadInfoManager.HeadInfoPool.ReUse(headInfoUnit.get_gameObject());
                 this.m_uis.RemoveAt(j);
                 break;
             }
         }
     }
     for (int k = 0; k < this.m_controls.get_Count(); k++)
     {
         HeadInfoControl headInfoControl = this.m_controls.get_Item(k);
         if (!(headInfoControl == null))
         {
             if (headInfoControl.uuid == uuid)
             {
                 headInfoControl.ResetAll();
                 this.m_controls.RemoveAt(k);
                 break;
             }
         }
     }
 }