public override void InterInit( AsBaseEntity _entity) { if( _entity.FsmType == eFsmType.PLAYER) Debug.Log( "AsModel:: InterInit: shop opening = " + _entity.GetProperty<bool>( eComponentProperty.SHOP_OPENING)); #if _USE_DUMMY_OBJECT CreateDummyObj( _entity.FsmType); #endif AsEntityManager.Instance.RequestModelLoading( this); }
public void Display( AsBaseEntity entity) { gameObject.SetActive(true); foreach( GameObject obj in gradeFrame) obj.SetActiveRecursively( false); eMonster_Grade eGrade = entity.GetProperty<eMonster_Grade>( eComponentProperty.GRADE); switch( eGrade) { case eMonster_Grade.Normal: gradeFrame[0].SetActiveRecursively( true); break; case eMonster_Grade.Elite: gradeFrame[1].SetActiveRecursively( true); break; case eMonster_Grade.Champion: gradeFrame[2].SetActiveRecursively( true); break; case eMonster_Grade.Boss: gradeFrame[3].SetActiveRecursively( true); break; case eMonster_Grade.DObject: case eMonster_Grade.QObject: Debug.LogWarning( "Target grade icon is not added: " + eGrade); break; case eMonster_Grade.Named: gradeFrame[4].SetActiveRecursively( true); break; case eMonster_Grade.Trap: break; default: Debug.LogError( "Invalid target grade : " + eGrade); break; } // eMonster_AttackType eAttackType = entity.GetProperty<eMonster_AttackType>( eComponentProperty.MONSTER_ATTACK_TYPE); // switch( eAttackType) // { // case eMonster_AttackType.Fool: // break; // case eMonster_AttackType.Peaceful: // break; // case eMonster_AttackType.Offensive: // break; // default: // Debug.LogError( "Invalid target attack type : " + eAttackType); // } }
public void Display( AsBaseEntity target) { gameObject.SetActive(true); styles[0].gameObject.SetActive( false); styles[1].gameObject.SetActive( false); if( null == target) return; eMonster_AttackStyle attackStyle = target.GetProperty<eMonster_AttackStyle>( eComponentProperty.MONSTER_ATTACK_STYLE); if( eMonster_AttackStyle.NONE == attackStyle) return; styles[ (int)attackStyle - 1].gameObject.SetActive( true); }
public void Display( AsBaseEntity entity) { gameObject.SetActive(true); foreach( SimpleSprite attr in attrs) attr.gameObject.SetActiveRecursively( false); int elementalIndex = entity.GetProperty<int>( eComponentProperty.ATTRIBUTE); switch( elementalIndex) { case 0: attrs[ (int)ePotency_Element.NONE].gameObject.SetActiveRecursively( true); break; case 1: case 6: case 10: attrs[ (int)ePotency_Element.Fire].gameObject.SetActiveRecursively( true); break; case 2: case 7: case 11: attrs[ (int)ePotency_Element.Ice].gameObject.SetActiveRecursively( true); break; case 3: case 8: case 12: attrs[ (int)ePotency_Element.Light].gameObject.SetActiveRecursively( true); break; case 4: case 9: case 13: attrs[ (int)ePotency_Element.Dark].gameObject.SetActiveRecursively( true); break; case 5: attrs[ (int)ePotency_Element.Nature].gameObject.SetActiveRecursively( true); break; } }
public void Display( AsBaseEntity entity) { gameObject.SetActive(true); foreach( SimpleSprite icon in typeIcons) icon.gameObject.SetActiveRecursively( false); eITEM_PRODUCT_TECHNIQUE_TYPE _type = (eITEM_PRODUCT_TECHNIQUE_TYPE)entity.GetProperty<int>( eComponentProperty.COLLECTOR_TECHNIC_TYPE); switch( _type) { case eITEM_PRODUCT_TECHNIQUE_TYPE.QUEST: typeIcons[3].gameObject.SetActiveRecursively( true); break; case eITEM_PRODUCT_TECHNIQUE_TYPE.MINERAL: typeIcons[2].gameObject.SetActiveRecursively( true); break; case eITEM_PRODUCT_TECHNIQUE_TYPE.SPIRIT: typeIcons[1].gameObject.SetActiveRecursively( true); break; case eITEM_PRODUCT_TECHNIQUE_TYPE.PLANTS: typeIcons[0].gameObject.SetActiveRecursively( true); break; } }
//get public bool CheckValidTargeting( AsBaseEntity _target) { if( ( skillRecord_.Skill_Type == eSKILL_TYPE.SlotBase || skillRecord_.Skill_Type == eSKILL_TYPE.Target) && ( _target == null || ( skillRecord_.CheckPotencyTypeIncludeResurrection() == false && ( _target.ContainProperty( eComponentProperty.LIVING) == true && _target.GetProperty<bool>( eComponentProperty.LIVING) == false) ))) { Map map = TerrainMgr.Instance.GetCurrentMap(); eMAP_TYPE mapType = map.MapData.getMapType; if( eMAP_TYPE.Town == mapType) AsMyProperty.Instance.AlertSkillInTown(); else { Debug.Log( "Msg_Player_Skill_Ready::CheckValidTargeting: AsMyProperty.Instance.AlertInvalidTarget()"); Debug.Log( "_target = " + _target); Debug.Log( "skillRecord_.CheckPotencyTypeIncludeResurrection() = " + skillRecord_.CheckPotencyTypeIncludeResurrection()); Debug.Log( "_target.ContainProperty( eComponentProperty.LIVING) = " + _target.ContainProperty( eComponentProperty.LIVING)); Debug.Log( "_target.GetProperty<bool>( eComponentProperty.LIVING) = " + _target.GetProperty<bool>( eComponentProperty.LIVING)); AsMyProperty.Instance.AlertInvalidTarget(); } return false; } return true; }
private void SetNpcInfo( AsBaseEntity target) { if( null == target ) return; AsNpcEntity _npcEntity = target as AsNpcEntity; if( null != _npcEntity ) { if( false == _npcEntity.isNoWarpIndex ) { gameObject.SetActiveRecursively(false); return; } } npcMark.gameObject.SetActiveRecursively( true); objectMark.gameObject.SetActiveRecursively( false); hpProgress.gameObject.SetActiveRecursively( true); attackStyleMgr.gameObject.SetActive( false); attrMgr.gameObject.SetActiveRecursively( false); gradeMgr.gameObject.SetActiveRecursively( false); collectionTypeMgr.gameObject.SetActiveRecursively( false); collectProgress.gameObject.SetActiveRecursively( false); userInfoButton.gameObject.SetActiveRecursively( false); chargeProgress.gameObject.SetActiveRecursively( false); ShowTargetSelectEffect( target); #region - target mark - targetMarkBtn.gameObject.SetActive( false); #endregion if( m_CurBaseEntity == target) return; m_CurBaseEntity = target; StringBuilder sb = new StringBuilder( target.GetProperty<string>( eComponentProperty.NAME)); sb.Insert( 0, Color.white.ToString()); Name = sb.ToString(); classText.Text = AsTableManager.Instance.GetTbl_String(1974); int nNpcID = target.GetProperty<int>( eComponentProperty.NPC_ID); Tbl_NormalNpc_Record normalNpcRec = AsTableManager.Instance.GetTbl_NormalNpc_Record( nNpcID); if( null != normalNpcRec ) { Level = normalNpcRec.NpcLV; hp_cur = hp_max = normalNpcRec.NpcHP; } InitProgressHP(); }
public void DeletePanel(AsBaseEntity _entity) { if (dicUseItemToTargetPanel.ContainsKey(_entity)) { Debug.LogWarning(_entity.GetProperty<string>(eComponentProperty.NAME) + "use item to panel is delete"); dicUseItemToTargetPanel.Remove(_entity); } }
private void _CreateNamePanel( AsBaseEntity baseEntity) { string strName = baseEntity.GetProperty<string>( eComponentProperty.NAME); switch( baseEntity.EntityType) { case eEntityType.USER: AsUserEntity entity = baseEntity as AsUserEntity; if( entity.namePanel != null) Destroy( entity.namePanel); if( m_ModelType == eModelType.Normal) AsHUDController.Instance.panelManager.CreateNamePanel_User( baseEntity, strName, ((AsUserEntity)baseEntity).UniqueId); break; case eEntityType.NPC: { if (strName != string.Empty) AsHUDController.Instance.panelManager.CreateNamePanel_Npc(baseEntity, strName, ((AsNpcEntity)baseEntity).TableIdx); if (baseEntity.namePanel != null) AsHUDController.Instance.panelManager.CreateQuestPanel_Npc(baseEntity, baseEntity.namePanel.NameText.BaseHeight); AsHUDController.Instance.panelManager.CreateUseItemToTargetPanel(baseEntity); } break; } baseEntity.TargetMarkProc(); }
private void SetUserInfo( AsBaseEntity target) { npcMark.gameObject.SetActiveRecursively( false); objectMark.gameObject.SetActiveRecursively( false); hpProgress.gameObject.SetActiveRecursively( true); collectProgress.gameObject.SetActiveRecursively( false); userInfoButton.gameObject.SetActiveRecursively( true); ShowTargetSelectEffect( target); attackStyleMgr.gameObject.SetActive( false); attrMgr.gameObject.SetActiveRecursively( false); gradeMgr.gameObject.SetActiveRecursively( false); collectionTypeMgr.gameObject.SetActiveRecursively( false); chargeProgress.gameObject.SetActiveRecursively( false); #region - target mark - if( AsPartyManager.Instance.IsCaptain == true && TargetDecider.CheckOtherUserIsEnemy( target) == true) targetMarkBtn.gameObject.SetActive( true); else targetMarkBtn.gameObject.SetActive( false); #endregion #if false // dawnsmell if( m_CurBaseEntity == target) return; #endif m_CurBaseEntity = target; float maxHP = target.GetProperty<float>( eComponentProperty.HP_MAX); float curHP = target.GetProperty<float>( eComponentProperty.HP_CUR); StringBuilder sb = new StringBuilder( target.GetProperty<string>( eComponentProperty.NAME)); sb.Insert( 0, Color.white.ToString()); Name = sb.ToString(); Level = target.GetProperty<int>( eComponentProperty.LEVEL); classText.Text = AsTableManager.Instance.GetTbl_String(1965); hp_max = maxHP; hp_cur = curHP; InitProgressHP(); }
private Color _GetStringColor(AsBaseEntity baseEntity) { if( null == baseEntity) return Color.white; Color color = Color.white; if( eEntityType.USER == baseEntity.EntityType) { // user color = AsHUDController.Instance.panelManager.m_NameColor_User; } else if( eEntityType.NPC == baseEntity.EntityType && eFsmType.NPC == baseEntity.FsmType) { // npc color = AsHUDController.Instance.panelManager.m_NameColor_Npc; } else if( eEntityType.NPC == baseEntity.EntityType && (eFsmType.MONSTER == baseEntity.FsmType ||eFsmType.COLLECTION == baseEntity.FsmType)) { // monster if( eFsmType.COLLECTION == baseEntity.FsmType ) color = AsHUDController.Instance.panelManager.m_NameColor_Default; else { eMonster_AttackType eAttackType = baseEntity.GetProperty<eMonster_AttackType>( eComponentProperty.MONSTER_ATTACK_TYPE); if( eMonster_AttackType.Fool == eAttackType) color = AsHUDController.Instance.panelManager.m_NameColor_Monster_Fool; else if( eMonster_AttackType.Peaceful == eAttackType) color = AsHUDController.Instance.panelManager.m_NameColor_Monster_Peaceful; else if( eMonster_AttackType.Offensive == eAttackType) color = AsHUDController.Instance.panelManager.m_NameColor_Monster_Offensive; } } else { color = AsHUDController.Instance.panelManager.m_NameColor_Default; } return color; }
public void CreatePanel(AsBaseEntity _entity) { int npcTableID = _entity.GetProperty<int>(eComponentProperty.NPC_ID); if (dicUseItemToTargetPanel.ContainsKey(_entity)) return; if (AsTableManager.Instance.IsUseItemToTargetEntity(npcTableID)) { AchUseItemToTarget useItemToTargetAch = ArkQuestmanager.instance.FindUseItemToTargetAchievement(npcTableID); if (useItemToTargetAch == null) return; if (ArkQuestmanager.instance.IsClearQuest(useItemToTargetAch.AssignedQuestID)) return; if (useItemToTargetAch.IsComplete == true) return; LoadModel(); // test string npcName = _entity.GetProperty<string>(eComponentProperty.NAME); Debug.LogWarning(npcName + " is Use Item To Target"); // make model GameObject objMark = GameObject.Instantiate(objModel) as GameObject; objMark.transform.parent = transform; //begin kij Item _item = ItemMgr.ItemManagement.GetItem( useItemToTargetAch.ItemID ); if( null == _item ) return; CoolTimeGroup coolTimeGroup = CoolTimeGroupMgr.Instance.GetCoolTimeGroup( _item.ItemData.itemSkill, _item.ItemData.itemSkillLevel ); if( null == coolTimeGroup ) return; // end kij GameObject itemIcon = AsStore.GetItemIcon(useItemToTargetAch.ItemID.ToString(), 1); UISlotItem slotItem = itemIcon.GetComponent<UISlotItem>(); BoxCollider itemCollider = slotItem.iconImg.gameObject.AddComponent<BoxCollider>(); itemIcon.transform.parent = objMark.transform.transform; itemIcon.transform.localPosition = new Vector3(0.0f, 0.0f, -1.0f); //begin kij slotItem.slotType = UISlotItem.eSLOT_TYPE.USE_COOLTIME; slotItem.ShowCoolTime(false); slotItem.coolTime.AlignScreenPos(); //end kij AsPanel_UseItemToTarget useItemToTargetPanel = objMark.AddComponent<AsPanel_UseItemToTarget>(); useItemToTargetPanel.Initilize(_entity, itemCollider, _entity.namePanel.NameText.BaseHeight + 2.5f, useItemToTargetAch, slotItem, coolTimeGroup); if (!dicUseItemToTargetPanel.ContainsKey(_entity)) dicUseItemToTargetPanel.Add(_entity, useItemToTargetPanel); UpdateUseItemToTargetPanel(useItemToTargetAch.ItemID); } }
public void SetTargetNpc( AsBaseEntity target) { if( target == null) { m_NpcMenu.Close(); AsHudDlgMgr.Instance.CloseStrengthenDlg(); //targetInfo.mobBuffMgr.ClearBuff(); } else { if( eNPCType.NPC == target.GetProperty<eNPCType>( eComponentProperty.NPC_TYPE)) { if( true == AsHudDlgMgr.Instance.IsOpenTradeRequestMsgBox) return; if( AsHudDlgMgr.Instance != null) { AsHudDlgMgr.Instance.Init( false); // all close HudDlg //targetInfo.mobBuffMgr.SetCharBuff( target); } m_NpcMenu.Open( target); } } }
private AsPanel_Name _CreateNamePanel(AsBaseEntity baseEntity, string strName, uint uiUserUniqueKey, float fSize, string strColorLower) { if( GAME_STATE.STATE_CHARACTER_SELECT == AsGameMain.s_gameState || GAME_STATE.STATE_CHARACTER_CREATE == AsGameMain.s_gameState) return null; if( null == baseEntity || null == baseEntity.ModelObject || string.Empty == strName) return null; AsPanel_Name namePanel = Instantiate( NamePanel) as AsPanel_Name; namePanel.gameObject.transform.parent = this.transform; namePanel.gameObject.transform.localPosition = Vector3.zero; Color nameColor = Color.white; AsPanel_Name.eNamePanelType eType = AsPanel_Name.eNamePanelType.eNamePanelType_None; if( eEntityType.USER == baseEntity.EntityType) { // user nameColor = m_NameColor_User; eType = AsPanel_Name.eNamePanelType.eNamePanelType_User; } else if( eEntityType.NPC == baseEntity.EntityType && eFsmType.NPC == baseEntity.FsmType) { // npc Color tableColor = _GetStringToColor( strColorLower); nameColor = ( Color.clear != tableColor) ? tableColor : m_NameColor_Npc; eType = AsPanel_Name.eNamePanelType.eNamePanelType_Npc; } else if( eEntityType.NPC == baseEntity.EntityType && (eFsmType.MONSTER == baseEntity.FsmType ||eFsmType.COLLECTION == baseEntity.FsmType)) { // monster Color tableColor = _GetStringToColor( strColorLower); if( eFsmType.COLLECTION == baseEntity.FsmType ) nameColor = ( Color.clear != tableColor) ? tableColor : m_NameColor_Default; else { eMonster_AttackType eAttackType = baseEntity.GetProperty<eMonster_AttackType>( eComponentProperty.MONSTER_ATTACK_TYPE); if( eMonster_AttackType.Fool == eAttackType) nameColor = ( Color.clear != tableColor) ? tableColor : m_NameColor_Monster_Fool; else if( eMonster_AttackType.Peaceful == eAttackType) nameColor = ( Color.clear != tableColor) ? tableColor : m_NameColor_Monster_Peaceful; else if( eMonster_AttackType.Offensive == eAttackType) nameColor = ( Color.clear != tableColor) ? tableColor : m_NameColor_Monster_Offensive; } if( eFsmType.COLLECTION == baseEntity.FsmType ) eType = AsPanel_Name.eNamePanelType.eNamePanelType_Collect; else eType = AsPanel_Name.eNamePanelType.eNamePanelType_Monster; } else { nameColor = m_NameColor_Default; eType = AsPanel_Name.eNamePanelType.eNamePanelType_None; } namePanel.Create( baseEntity, strName, nameColor, eType, uiUserUniqueKey, fSize); // for monster target mark if (baseEntity.FsmType == eFsmType.MONSTER) { if (namePanel != null) { namePanel.callBeforDestory = DeleteMonsterNamePanel; listMonsterNamePanel.Add(namePanel); } } return namePanel; }
private void SetCollectionInfo( AsBaseEntity target ) { attackStyleMgr.gameObject.SetActive( false); attrMgr.gameObject.SetActiveRecursively( false); gradeMgr.gameObject.SetActiveRecursively( false); npcMark.gameObject.SetActiveRecursively( false); objectMark.gameObject.SetActiveRecursively( false); userInfoButton.gameObject.SetActiveRecursively( false); collectProgress.gameObject.SetActiveRecursively( true); hpProgress.gameObject.SetActiveRecursively( false); chargeProgress.gameObject.SetActiveRecursively( false); ShowTargetSelectEffect( target); collectionTypeMgr.Display( target); #region - target mark - targetMarkBtn.gameObject.SetActive( false); #endregion eITEM_PRODUCT_TECHNIQUE_TYPE _type = (eITEM_PRODUCT_TECHNIQUE_TYPE)target.GetProperty<int>( eComponentProperty.COLLECTOR_TECHNIC_TYPE); switch( _type) { case eITEM_PRODUCT_TECHNIQUE_TYPE.MINERAL: classText.Text = AsTableManager.Instance.GetTbl_String(1973); break; case eITEM_PRODUCT_TECHNIQUE_TYPE.SPIRIT: classText.Text = AsTableManager.Instance.GetTbl_String(1972); break; case eITEM_PRODUCT_TECHNIQUE_TYPE.PLANTS: classText.Text = AsTableManager.Instance.GetTbl_String(1971); break; case eITEM_PRODUCT_TECHNIQUE_TYPE.QUEST: classText.Text = AsTableManager.Instance.GetTbl_String(819); break; } if( m_CurBaseEntity == target) return; uint iCollectorIdx = target.GetProperty<uint>( eComponentProperty.COLLECTOR_IDX); if( 0 != iCollectorIdx ) return; m_CollectBaseEntity = target; m_CurBaseEntity = target; if (_type == eITEM_PRODUCT_TECHNIQUE_TYPE.QUEST) Level = 1; else Level = target.GetProperty<int>( eComponentProperty.LEVEL); StringBuilder sb = new StringBuilder( target.GetProperty<string>( eComponentProperty.NAME)); sb.Insert( 0, Color.red.ToString()); Name = sb.ToString(); float maxHP = target.GetProperty<float>( eComponentProperty.HP_MAX); float curHP = target.GetProperty<float>( eComponentProperty.HP_CUR); hp_max = maxHP; hp_cur = curHP; InitCollectionProgress(); }
public bool UpdateCollectionSimpleInfo( AsBaseEntity target) { float maxHP = target.GetProperty<float>( eComponentProperty.HP_MAX); float curHP = target.GetProperty<float>( eComponentProperty.HP_CUR); hp_max = maxHP; hp_cur = curHP; InitCollectionProgress(); if( 0.0f >= curHP) { gameObject.SetActiveRecursively( false); } return ( 0.0f >= curHP) ? false : true; }
// ilmeda 20120425 > public bool UpdateTargetSimpleInfo( AsBaseEntity target) { float maxHP = target.GetProperty<float>( eComponentProperty.HP_MAX); float curHP = target.GetProperty<float>( eComponentProperty.HP_CUR); hp_max = maxHP; hp_cur = curHP; InitProgressHP(); if( 1f > curHP) { gameObject.SetActiveRecursively( false); mobBuffMgr.EmptyOtherUserFsm(); AsEntityManager.Instance.GetPlayerCharFsm().Target = null; } return ( 0.0f >= curHP) ? false : true; }
private IEnumerator _ShowTargetSelectEffect(AsBaseEntity target) { if( null == target.gameObject) yield return null; GameObject goTarget = target.gameObject; if( null != AsEffectManager.Instance.GetEffectEntity( m_nTargetSelectEff)) RemoveTargetSelectEffect(); string strTargetSelectEffPath = string.Empty; if( eFsmType.MONSTER == target.FsmType) strTargetSelectEffPath = m_strTargetSelectEffPath_Red; else strTargetSelectEffPath = m_strTargetSelectEffPath_White; m_nTargetSelectEff = AsEffectManager.Instance.PlayEffect( strTargetSelectEffPath, goTarget.transform, true, 0.0f); float fScale = 1.0f; if( eFsmType.OTHER_USER != target.FsmType) { int nNpcID = target.GetProperty<int>( eComponentProperty.NPC_ID); Tbl_Npc_Record npcRec = AsTableManager.Instance.GetTbl_Npc_Record( nNpcID); if( 1 == npcRec.PointScale) fScale = 1.0f; else if( 2 == npcRec.PointScale) fScale = 1.2f; else if( 3 == npcRec.PointScale) fScale = 1.5f; else if( 4 == npcRec.PointScale) fScale = 2.0f; else if( 5 == npcRec.PointScale) fScale = 2.5f; } fScale *= target.GetCharacterSize(); AsEffectManager.Instance.SetSize( m_nTargetSelectEff, fScale); }
public static bool SkillTargetStateCheck( Tbl_Skill_Record skillRecord, AsBaseEntity entity, bool _showAlert = true) { bool ret = false; switch( skillRecord.SkillIcon_Enable_Condition) { case eSkillIcon_Enable_Condition.NONE: return true; case eSkillIcon_Enable_Condition.LowHealth: if(entity.ContainProperty(eComponentProperty.HP_CUR) == true) { float curHP = entity.GetProperty<float>( eComponentProperty.HP_CUR); if( curHP < skillRecord.SkillIcon_Enable_ConditionValue) ret = true; } break; case eSkillIcon_Enable_Condition.Death: if(entity.ContainProperty(eComponentProperty.LIVING) == true) { bool isDied = entity.GetProperty<bool>( eComponentProperty.LIVING); ret = !isDied; } break; case eSkillIcon_Enable_Condition.Movable: AsUserEntity player = AsUserInfo.Instance.GetCurrentUserEntity(); ret = player.CheckCondition( eSkillIcon_Enable_Condition.Movable) && player.GetProperty<bool>(eComponentProperty.LIVING); break; default: ret = entity.CheckCondition( skillRecord.SkillIcon_Enable_Condition); break; } if( false == ret && _showAlert == true) AsMyProperty.Instance.AlertState(); return ret; }
private void SetMobInfo( AsBaseEntity target) { eMonster_Grade eGrade = target.GetProperty<eMonster_Grade>( eComponentProperty.GRADE); if( eMonster_Grade.DObject == eGrade || eMonster_Grade.Treasure == eGrade || eMonster_Grade.QObject == eGrade) { SetMobObjectInfo( target); return; } npcMark.gameObject.SetActiveRecursively( false); objectMark.gameObject.SetActiveRecursively( false); hpProgress.gameObject.SetActiveRecursively( true); collectProgress.gameObject.SetActiveRecursively( false); userInfoButton.gameObject.SetActiveRecursively( false); chargeProgress.gameObject.SetActiveRecursively( false); m_CurBaseEntity = target; float maxHP = target.GetProperty<float>( eComponentProperty.HP_MAX); float curHP = target.GetProperty<float>( eComponentProperty.HP_CUR); StringBuilder sb = new StringBuilder( target.GetProperty<string>( eComponentProperty.NAME)); sb.Insert( 0, Color.red.ToString()); Name = sb.ToString(); Level = target.GetProperty<int>( eComponentProperty.LEVEL); eGrade = target.GetProperty<eMonster_Grade>( eComponentProperty.GRADE); switch( eGrade) { case eMonster_Grade.Normal: case eMonster_Grade.DObject: case eMonster_Grade.QObject: classText.Text = AsTableManager.Instance.GetTbl_String(1966); break; case eMonster_Grade.Elite: classText.Text = AsTableManager.Instance.GetTbl_String(1967); break; case eMonster_Grade.Champion: classText.Text = AsTableManager.Instance.GetTbl_String(1968); break; case eMonster_Grade.Boss: classText.Text = AsTableManager.Instance.GetTbl_String(1970); break; case eMonster_Grade.Named: classText.Text = AsTableManager.Instance.GetTbl_String(1969); break; } #region - target mark - if( AsPartyManager.Instance.IsCaptain == true && (eGrade == eMonster_Grade.Normal || eGrade == eMonster_Grade.Elite || eGrade == eMonster_Grade.Champion || eGrade == eMonster_Grade.Boss || eGrade == eMonster_Grade.Named || eGrade == eMonster_Grade.DObject)) targetMarkBtn.gameObject.SetActive( true); else targetMarkBtn.gameObject.SetActive( false); #endregion hp_max = maxHP; hp_cur = curHP; InitProgressHP(); ShowTargetSelectEffect( target); attackStyleMgr.Display( target); attrMgr.Display( target); gradeMgr.Display( target); collectionTypeMgr.gameObject.SetActiveRecursively( false); }
private void SetMobObjectInfo( AsBaseEntity target) { attackStyleMgr.gameObject.SetActive( false); attrMgr.gameObject.SetActiveRecursively( false); gradeMgr.gameObject.SetActiveRecursively( false); collectionTypeMgr.gameObject.SetActiveRecursively( false); npcMark.gameObject.SetActiveRecursively( false); objectMark.gameObject.SetActiveRecursively( true); hpProgress.gameObject.SetActiveRecursively( true); chargeProgress.gameObject.SetActiveRecursively( false); collectProgress.gameObject.SetActiveRecursively( false); level.gameObject.SetActiveRecursively( true); nameText.gameObject.SetActiveRecursively( true); classText.Text = AsTableManager.Instance.GetTbl_String(1975); userInfoButton.gameObject.SetActiveRecursively( false); ShowTargetSelectEffect( target); #region - target mark - targetMarkBtn.gameObject.SetActive( true); #endregion if( m_CurBaseEntity == target) return; m_CurBaseEntity = target; StringBuilder sb = new StringBuilder( target.GetProperty<string>( eComponentProperty.NAME)); sb.Insert( 0, Color.white.ToString()); Name = sb.ToString(); Level = target.GetProperty<int>( eComponentProperty.LEVEL); hp_max = target.GetProperty<float>( eComponentProperty.HP_MAX); hp_cur = target.GetProperty<float>( eComponentProperty.HP_CUR); InitProgressHP(); }
public bool Open( AsBaseEntity target , bool _callFromQuestClear = false) { AsChatFullPanel.Instance.Close(); if( target == null) return false; targetObject = target.gameObject; Clear(); if( eNPCType.NPC == target.GetProperty<eNPCType>( eComponentProperty.NPC_TYPE)) { m_NpcEntity = target as AsNpcEntity; m_NpcRec = AsTableManager.Instance.GetTbl_NormalNpc_Record( m_NpcEntity.TableIdx); //npc name Tbl_Npc_Record record = AsTableManager.Instance.GetTbl_Npc_Record( m_NpcEntity.TableIdx); npcName = m_NpcName.Text = record.NpcName; m_NpcTableID = m_NpcEntity.TableIdx; } if( null == m_NpcRec) { Debug.LogError( "null == m_NpcRec"); return false; } if( m_NpcRec.FaceId != int.MaxValue)//none { int textNum = 1 + ( m_NpcRec.FaceId / ( m_TextureCount*m_TextureCount)); string strImageFileName = "UI/Optimization/Texture/img_NPC_" + textNum; Texture2D npcImage = ResourceLoad.Loadtexture( strImageFileName) as Texture2D; Set_Tex( m_Npc_Image, npcImage, m_NpcRec.FaceId, m_TextureSize, m_TextureCount); } questHolder = QuestHolderManager.instance.GetQuestHolder( m_NpcTableID); //Pc Image Setting AsUserEntity entity = AsEntityManager.Instance.UserEntity; if( null != entity) { int faceImageId = 0; eCLASS __class = entity.GetProperty<eCLASS>( eComponentProperty.CLASS); eGENDER gender = entity.GetProperty<eGENDER>( eComponentProperty.GENDER); eRACE tribe = entity.GetProperty<eRACE>( eComponentProperty.RACE); Tbl_Class_Record record = AsTableManager.Instance.GetTbl_Class_Record( tribe, __class); switch( gender) { case eGENDER.eGENDER_MALE: faceImageId = record.Portrait_Male; break; case eGENDER.eGENDER_FEMALE: faceImageId = record.Portrait_Female; break; } int textureNum = 1 + ( faceImageId / ( m_TextureCount*m_TextureCount)); string strPcImageFileName = "UI/Optimization/Texture/img_PC_" + textureNum; Texture2D pcImage = ResourceLoad.Loadtexture( strPcImageFileName) as Texture2D; Set_Tex( m_Pc_Image, pcImage, faceImageId, m_TextureSize, m_TextureCount); } // for talk clear if( ( false == _callFromQuestClear) && ( true == CheckTalkComplete())) return true; gameObject.SetActiveRecursively( true); gameObject.active = true; if(0 != m_NpcRec.VoiceCount) { int VoiceIndex = UnityEngine.Random.Range( 0, m_NpcRec.VoiceCount); AsSoundManager.Instance.PlaySound( m_NpcRec.Voice(VoiceIndex), Vector3.zero, false);////npc Voice } int SpeechIndex = UnityEngine.Random.Range( 0, m_NpcRec.SpeechCount); SetTalk( m_NpcRec.Speech( SpeechIndex));////npc Speech if( m_NpcRec.FaceId == int.MaxValue)//none SetVisible( m_Npc_Image.gameObject, false); SetVisible( m_Pc_Image.gameObject, false); UpdateMenuButton(); // check clear quest m_Questlist.FindQuestFromObject( m_NpcEntity.gameObject); ArkSphereQuestTool.QuestData questData = m_Questlist.GetClearQuest(); if( questData != null) AsHudDlgMgr.Instance.OpenQuestAcceptUI(questData, true); m_Questlist.Visible = false; AsHudDlgMgr.dlgPresentState |= AsHudDlgMgr.eDlgPresentState.NpcMenu; if (questHolder != null) QuestTutorialMgr.Instance.ProcessQuestTutorialMsg(new QuestTutorialMsgInfo(QuestTutorialMsg.OPEN_NPC_TALK)); //{ // QuestTutorialMgr.Instance.ProcessQuestTutorialMsg(new QuestTutorialMsgInfo(QuestTutorialMsg.OPEN_NPC_TALK)); // if (questHolder.NowMarkType == QuestMarkType.HAVE_EVENT || questHolder.nowQuetMarkType == QuestMarkType.HAVE_EVENT_AND_PROGRESS) // if (m_NpcEntity != null) // questHolder.UpdateQuestMark(m_NpcEntity.TableIdx); //} return true; }