コード例 #1
0
ファイル: Player.cs プロジェクト: wuhuolong/MaxBooks
    /// <summary>
    /// 设置头顶的ICON
    /// </summary>
    public override void SetHeadIcons(EHeadIcon icon_type)
    {
        TextNameBehavior textNameBehavoir = GetBehavior <TextNameBehavior>();

        if (textNameBehavoir == null)
        {
            return;
        }

        textNameBehavoir.EnableBehaviors(mVisibleCtrl.VisibleMode == EVisibleMode.Visible /* && !IsDead()*/);

        if ((icon_type & EHeadIcon.TEAM) == EHeadIcon.TEAM)
        {
            string spriteName = "";
            bool   isShow     = false;
            if (TeamManager.Instance.IsLeader(UID.obj_idx) == true)
            {
                spriteName = "MainWindow_New@TeamWindow@LeaderTag";
                isShow     = true;
            }
            else if (TeamManager.Instance.IsMember(UID.obj_idx) == true)
            {
                spriteName = "MainWindow_New@TeamWindow@MemberTag";
                isShow     = true;
            }
            textNameBehavoir.ShowTeamIcon(spriteName, isShow);
        }
        else if ((icon_type & EHeadIcon.PEAK) == EHeadIcon.PEAK)
        {
            bool isPeak = TransferHelper.IsPeak((uint)Level, TransferLv);
            textNameBehavoir.ShowPeakTeamIcon(isPeak);
        }
    }
コード例 #2
0
ファイル: LocalPlayer.cs プロジェクト: wuhuolong/MaxBooks
    public void RefreshPlayerHpBar()
    {
        TextNameBehavior nameBehavoir = GetBehavior <TextNameBehavior>();

        if (nameBehavoir == null)
        {
            return;
        }
        UI3DText.StyleInfo info = nameBehavoir.DataStyleInfo;
        if (info == null)
        {
            return;
        }

        // 和平模式(且没有锁定的攻击敌人),不显示血条,破碎死域副本内要总是显示血条
        if (PKModeManagerEx.Instance.CanShowPVPBlood(this) == false && SceneHelp.Instance.ForceShowHpBar == false)
        {
            SetShowBar(info, false);
        }
        else
        {
            SetShowBar(info, true);
        }

        nameBehavoir.RefreshStyle();
    }
コード例 #3
0
ファイル: RemotePlayer.cs プロジェクト: wuhuolong/MaxBooks
    protected override void SetNameStyle()
    {
        UI3DText.StyleInfo styleInfo = new UI3DText.StyleInfo();
        styleInfo.Offset       = new Vector3(0, 2.8f, 0);
        styleInfo.HeadOffset   = new Vector3(0, this.Height, 0);
        styleInfo.ScreenOffset = UI3DText.NameTextScreenOffset;
        styleInfo.Scale        = Vector3.one;

        bool show_tips = false;

        styleInfo.IsShowBg  = PKModeManagerEx.Instance.IsLocalPlayerCanAttackActor(this, ref show_tips);
        styleInfo.SpritName = "Main@PKCan";
        int labelWidth = 100;//UserName.Length * 20;

        styleInfo.SpriteWidth     = labelWidth + 30;
        show_tips                 = false;
        styleInfo.IsShowBgPreHead = PKModeManagerEx.Instance.IsActorCanAttackLocalPlayer(this, ref show_tips);
        if (styleInfo.IsShowBg)
        {
            styleInfo.BgPreHeadOffset = new Vector3(styleInfo.SpriteWidth / 2 - 145, 2, 0);
        }
        else
        {
            styleInfo.BgPreHeadOffset = new Vector3(labelWidth / 2 - 110, 2, 0);
        }

        Actor local_player = Game.Instance.GetLocalPlayer();

        show_tips = false;
        styleInfo.IsEnemyRelation = !(PKModeManagerEx.Instance.IsFriendRelation(local_player, this));

        //更新归属
        xc.Machine.State       curState          = Game.GetInstance().GetFSM().GetCurState();
        CommonLuaInstanceState wildInstanceState = curState as CommonLuaInstanceState;

        if (wildInstanceState != null && wildInstanceState.DataBossBehaviour != null)
        {
            styleInfo.IsShowAffiliationPanel = wildInstanceState.DataBossBehaviour.IsAffiliation(this);
        }

        if (SceneHelp.Instance.IsInWorldBossExperienceInstance && this.IsLocalPlayer == false && this.IsPlayer() && this.IsDead())
        {
            styleInfo.LayoutIsVisiable = false;
        }
        else
        {
            styleInfo.LayoutIsVisiable = true;
        }

        // 和平模式,不显示血条,破碎死域副本内要总是显示血条
        if (PKModeManagerEx.Instance.CanShowPVPBlood(this) == false && SceneHelp.Instance.ForceShowHpBar == false)
        {
            SetShowBar(styleInfo, false);
        }
        else
        {
            SetShowBar(styleInfo, true);
        }

        TextNameBehavior nameBehavoir = GetBehavior <TextNameBehavior>();

        nameBehavoir.SetStyle(styleInfo);
    }