public void Create(AsBaseEntity _baseEntity, float _namePanelPosY) { m_bShowCommand = true; m_baseEntity = _baseEntity; gameObject.SetActive(true); // string strNameRes = string.Empty; // string strNameBuf = string.Empty; m_vUIPosRevision.x = 0.0f; m_vUIPosRevision.y = _namePanelPosY + questSprites[0].height * 0.5f; m_vUIPosRevision.z = m_fNamePanelLayer; 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"); } else transform.position = _WorldToUIPoint(dummyLeadTop.position, m_vUIPosRevision);////////// _baseEntity.questPanel = this; }
//public void SetMarkType(QuestMarkType _type) //{ // try // { // nowType = _type; // foreach (SimpleSprite sprite in questSprites) // sprite.Hide(true); // if (nowType == QuestMarkType.CLEAR_REMAINTALK || nowType == QuestMarkType.TALK_CLEAR || nowType == QuestMarkType.TALK_HAVE) // questSprites[(int)QuestPanelType.QUEST_NEW_TALK].Hide(false); // else if (nowType == QuestMarkType.CLEAR || nowType == QuestMarkType.CLEAR_AND_HAVE) // questSprites[(int)QuestPanelType.QUEST_CLAR].Hide(false); // else if (nowType == QuestMarkType.HAVE) // questSprites[(int)QuestPanelType.QUEST_NEW].Hide(false); // else if (nowType == QuestMarkType.UPPERLEVEL) // questSprites[(int)QuestPanelType.QUEST_NEW_UPPERLEVEL].Hide(false); // } // catch (System.Exception e) // { // Debug.LogError(e.Message); // } //} public void Initilize(AsBaseEntity _baseEntity, BoxCollider _collider, float _namePanelPosY, AchUseItemToTarget _achUseItemToTarget, UISlotItem _slotItem, CoolTimeGroup _coolTimeGroup) { m_bShowCommand = true; m_baseEntity = _baseEntity; achUseItemToTarget = _achUseItemToTarget; slotItem = _slotItem; coolTimeGroup = _coolTimeGroup; gameObject.SetActiveRecursively(true); if (_baseEntity.questPanel != null) _baseEntity.questPanel.gameObject.SetActiveRecursively(false); if (_baseEntity.collectionMark != null) _baseEntity.collectionMark.Visible = false; itemCollider = _collider; // Calculate U.I Position m_vUIPosRevision.x = 0.0f; m_vUIPosRevision.y = _namePanelPosY;// +questSprites[0].height * 0.5f; m_vUIPosRevision.z = m_fNamePanelLayer; 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"); } else transform.position = _WorldToUIPoint(dummyLeadTop.position, m_vUIPosRevision);////////// }
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; }