Exemplo n.º 1
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();
            }
        }
    }
Exemplo n.º 2
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();
        }
    }