| | |
| | |
|
| | | int npcId = 0;
|
| | | int index = 0;
|
| | | Vector3 jumpPoint = Vector3.zero;
|
| | |
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
|
| | | FairyLeagueModel fairyLeagueModel { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } }
|
| | |
|
| | | private void Start()
|
| | | {
|
| | | if (m_Moveto != null)
|
| | | {
|
| | | m_Moveto.SetListener(MoveTo);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Display(int npcId, TextColType colorType)
|
| | | {
|
| | | this.npcId = npcId;
|
| | | var config = NPCConfig.Get(this.npcId);
|
| | | switch (m_TagType)
|
| | | {
|
| | | case TagType.Function:
|
| | |
| | | case TagType.WayPoint:
|
| | | break;
|
| | | case TagType.Boss:
|
| | | m_NpcName.text = config.charName;
|
| | | m_Level.text = Language.Get("HeadUpName_Monster", config.NPCLV);
|
| | | m_NpcName.colorType = colorType;
|
| | | var dangerous = PlayerDatas.Instance.baseData.LV <= config.NPCLV;
|
| | | m_Level.color = UIHelper.GetUIColor(dangerous ? TextColType.Red : TextColType.Green, false);
|
| | | break;
|
| | | case TagType.Elite:
|
| | | case TagType.Monster:
|
| | | var config = NPCConfig.Get(this.npcId);
|
| | | m_NpcName.text = config.charName;
|
| | | m_NpcName.colorType = colorType;
|
| | | break;
|
| | | case TagType.Crystal:
|
| | | this.OnCrystalStateChange(this.npcId);
|
| | | m_Moveto.RemoveAllListeners();
|
| | | m_Moveto.AddListener(MoveTo);
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | fairyLeagueModel.UpdateWarCrystalEvent -= OnCrystalStateChange;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void Display(int npcId, TextColType colorType, Vector3 _position)
|
| | | public void Display(Vector3 position)
|
| | | {
|
| | | this.npcId = npcId;
|
| | | switch (m_TagType)
|
| | | {
|
| | | case TagType.Boss:
|
| | | var config = NPCConfig.Get(this.npcId);
|
| | | m_NpcName.text = config.charName;
|
| | | m_Level.text = Language.Get("HeadUpName_Monster", config.NPCLV);
|
| | | m_NpcName.colorType = colorType;
|
| | | var dangerous = PlayerDatas.Instance.baseData.LV <= config.NPCLV;
|
| | | m_Level.color = UIHelper.GetUIColor(dangerous ? TextColType.Red : TextColType.Green, false);
|
| | | m_Moveto.SetListener(MoveTo);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | jumpPoint = position;
|
| | | }
|
| | |
|
| | | public void Display(int index)
|
| | | {
|
| | | this.index = index;
|
| | | switch (m_TagType)
|
| | | {
|
| | | case TagType.FairyLeagueBuff:
|
| | | m_Moveto.SetListener(MoveTo);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | |
| | | hero.MoveToPosition(new Vector3(buffPos.x, hero.Pos.y, buffPos.y));
|
| | | }
|
| | | }
|
| | | break;
|
| | | case TagType.JumpPoint:
|
| | | MapTransferUtility.Instance.MoveToLocalMapPosition(new Vector3(jumpPoint.x, jumpPoint.z, 0) * 2);
|
| | | break;
|
| | | default:
|
| | | {
|
| | |
| | | WayPoint = 5,
|
| | | Crystal = 6,
|
| | | FairyLeagueBuff = 7,
|
| | | JumpPoint = 8
|
| | | }
|
| | |
|
| | | }
|