示例#1
0
	public void Create( AsBaseEntity baseEntity, string strName, Color nameColor, eNamePanelType eType, uint uiUserUniqueKey, float fSize)
	{
		m_bShowCommand = true;
		m_eNamePanelType = eType;
		m_uiUserUniqueKey = uiUserUniqueKey;
		m_baseEntity = baseEntity;
		
		m_strSubTitleName = _GetSubTitleName( eType);
		m_strName = strName;
		m_strGroupName = _GetGroupName( eType);
		m_strPvpGrade = _GetPvpGrade();
#if !NEW_DELEGATE_IMAGE
		m_bShowPvpGrade = AsGameMain.GetOptionState( OptionBtnType.OptionBtnType_PvpGrade);
#endif

		gameObject.SetActiveRecursively( true);

		string strNameRes = string.Empty;
		string strNameBuf = string.Empty;
		
//		StringBuilder sb = new StringBuilder( "");

		m_sbName.Remove( 0, m_sbName.Length);

		if( m_strPvpGrade.Length > 0)
		{
			m_sbName.Append( m_strPvpGradeColor);
			m_sbName.Append( m_strPvpGrade);
		}
		
		if( m_strSubTitleName.Length > 0)
		{
			m_sbName.Append( " ");
			m_sbName.Append( _GetSubTitleColor( eType));
			m_sbName.Append( m_strSubTitleName);
		}
		
		if( m_strPvpGrade.Length > 0 || m_strSubTitleName.Length > 0)
			m_sbName.Append( " ");
		
		m_sbName.Append( nameColor.ToString());
		m_sbName.Append( strName);
		strNameBuf = m_sbName.ToString();
		
		if( m_strGroupName.Length > 0)
			strNameRes = strNameBuf + "\n<" + m_strGroupName + ">";
		else
			strNameRes = strNameBuf;
		
		NameText.name = strName;
		NameText.Text = strNameRes;
		NameText.Color = nameColor;
		
		m_vUIPosRevision.x = 0.0f;
		m_vUIPosRevision.y = NameText.BaseHeight;
		m_vUIPosRevision.z = m_fNamePanelLayer;
		if( AsUserInfo.Instance.SavedCharStat.uniqKey_ == uiUserUniqueKey)
			m_vUIPosRevision.z -= 1.0f;
		
		if( eNamePanelType.eNamePanelType_Npc == eType)
			m_vUIPosRevision.y = 0.0f;

		Transform dummyLeadTop = m_baseEntity.GetDummyTransform( "DummyLeadTop");
		if( null == dummyLeadTop)
		{
			if( true == m_baseEntity.isKeepDummyObj)
			{
				Vector3 vPos = m_baseEntity.transform.position;
				vPos.y += m_baseEntity.characterController.height;
				transform.position = _WorldToUIPoint( vPos, m_vUIPosRevision);
			}
			else
				Debug.LogWarning( "DummyLeadTop is not found: " + strName);
		}
		else
		{
			transform.position = _WorldToUIPoint( dummyLeadTop.position, m_vUIPosRevision);
		}
		
		if( eNamePanelType.eNamePanelType_Npc == eType)
			_CreateImage();
		
		if( eNamePanelType.eNamePanelType_Monster == eType || eNamePanelType.eNamePanelType_Collect == eType )
			NameText.renderer.enabled = false;
		
		NameImage_bg.renderer.enabled = false;
		NameImage_img.renderer.enabled = false;
		authorityMark.renderer.enabled = false;
		btnTargetMark.collider.enabled = false; //$yde
		imgTargetMark.renderer.enabled = false; //$yde
		btnTargetMark.SetInputDelegate( OnTargetMark); //$yde

        UpdateMonsterTarkMark();

		SetRankMark();
		SetGenderMark( eType, baseEntity);
		SetDelegateImage( eType, baseEntity);

		baseEntity.namePanel = this;
	}
示例#2
0
	private string _GetSubTitleColor(eNamePanelType eType)
	{
		string strBuf = AsHUDController.Instance.panelManager.m_NameColor_User.ToString();
		
		if( eNamePanelType.eNamePanelType_User == eType)
		{
			if( null == AsPartyManager.Instance.GetPartyMember( m_uiUserUniqueKey))
			{
				AsUserEntity userEntity = m_baseEntity as AsUserEntity;
				if( 0 < userEntity.DesignationID)
				{
					DesignationData data = AsDesignationManager.Instance.GetDesignation( userEntity.DesignationID);
					if( null != data)
						strBuf = data.nameColor;
				}
			}
		}
		
		return strBuf;
	}
示例#3
0
	private string _GetSubTitleName(eNamePanelType eType)
	{
		string strBuf = string.Empty;
		
		if( eNamePanelType.eNamePanelType_User == eType)
		{
			AsUserEntity userEntity = m_baseEntity as AsUserEntity;
			
			if( AsUserInfo.Instance.SavedCharStat.uniqKey_ == m_uiUserUniqueKey)
			{
				if( true == AsUserInfo.Instance.SavedCharStat.bSubtitleHide)
					return "";
			}
			else
			{
				if( true == userEntity.SubTitleHide)
					return "";
			}
			
			if( 0 < userEntity.DesignationID)
			{
				DesignationData data = AsDesignationManager.Instance.GetDesignation( userEntity.DesignationID);
				if( null == data)
				{
					Debug.Log( "AsPanel_Name::_GetBubTitleName(), Not Found SubTitleNameID: " + userEntity.DesignationID);
					return "";
				}

				strBuf = AsTableManager.Instance.GetTbl_String( data.name);
			}
		}
		
		return strBuf;
	}
示例#4
0
	private string _GetGroupName(eNamePanelType eType)
	{
		string strBuf = string.Empty;
		
		if( eNamePanelType.eNamePanelType_User == eType)
		{
			// guild check
			string strGuildName = m_baseEntity.GetProperty<string>( eComponentProperty.GUILD_NAME);
			if( strGuildName.Length > 0)
			{
//				strBuf = '<' + strGuildName + '>';
				strBuf = strGuildName;
			}
		}
		else if( eNamePanelType.eNamePanelType_Npc == eType || eNamePanelType.eNamePanelType_Monster == eType || eNamePanelType.eNamePanelType_Collect == eType)
		{
			Tbl_Npc_Record NpcRecord = AsTableManager.Instance.GetTbl_Npc_Record( ((AsNpcEntity)m_baseEntity).TableIdx);
			if( null != NpcRecord)
			{
				if( false == NpcRecord.NpcGName.ToLower().Equals( "none"))
					strBuf = '<' + NpcRecord.NpcGName + '>';
			}
		}
		
		return strBuf;
	}
示例#5
0
	public void SetGenderMark( eNamePanelType type, AsBaseEntity entity)
	{
		if( AsPanel_Name.eNamePanelType.eNamePanelType_User != type)
		{
			genders[0].renderer.enabled = false;
			genders[1].renderer.enabled = false;
			gmMark.renderer.enabled = false;
			return;
		}

#if NEW_DELEGATE_IMAGE
		genders[0].renderer.enabled = false;
		genders[1].renderer.enabled = false;

		if( AsPanel_Name.eNamePanelType.eNamePanelType_User == type)
		{
			AsUserEntity userEntity = entity as AsUserEntity;
			UpdateGMMark( userEntity.IsGM);
		}
		else
			gmMark.renderer.enabled = false;
#else
		AsUserEntity userEntity = entity as AsUserEntity;
		UpdateGender( userEntity.UserGender);
		UpdateGMMark( userEntity.IsGM);
#endif
	}
示例#6
0
	public void SetDelegateImage(eNamePanelType type, AsBaseEntity entity)
	{
#if NEW_DELEGATE_IMAGE
		if( AsPanel_Name.eNamePanelType.eNamePanelType_User != type)
		{
			delegateImage.renderer.enabled = false;
			return;
		}

		AsUserEntity userEntity = entity as AsUserEntity;
		UpdateDelegateImage( userEntity.nUserDelegateImageIndex);
		UpdateGMMark( userEntity.IsGM);
#else
		delegateImage.renderer.enabled = false;
#endif
	}