private void FollowPlayer(EventArgs args) { if (m_step == 0) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col + 1); } IntEventArgs _args = new IntEventArgs(m_step); long _id = TimerManager.StartTimer(500, false, _args, DelayExecuteEnemies, 0); m_timerIdList.Add(_id); ++m_step; } else if (m_step == 1) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col); } IntEventArgs _args = new IntEventArgs(m_step); long _id = TimerManager.StartTimer(500, false, _args, DelayExecuteEnemies, 0); m_timerIdList.Add(_id); ++m_step; } else if (m_step == 2) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col - 2); } IntEventArgs _args = new IntEventArgs(m_step); long _id = TimerManager.StartTimer(500, false, _args, DelayExecuteEnemies, 0); m_timerIdList.Add(_id); ++m_step; MissionList.Instance.m_mission1_2 = true; MissionList.Instance.m_mission1_3 = true; } else if (m_step == 3) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col + 2); } ++m_step; } }
private void FollowPlayer(EventArgs args) { if (m_step == 0) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col + 1); } IntEventArgs _args = new IntEventArgs(m_step); long _id = TimerManager.StartTimer(1500, false, _args, DelayExecuteEnemies, 0); m_timerIdList.Add(_id); ++m_step; } else if (m_step == 1) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col); } IntEventArgs _args = new IntEventArgs(m_step); long _id = TimerManager.StartTimer(1500, false, _args, DelayExecuteEnemies, 0); m_timerIdList.Add(_id); ++m_step; } else if (m_step == 2) { for (int _i = 0; _i < m_followList.Count; ++_i) { Follower _follower = m_followList[_i].GetComponent <Follower>(); int _row = _follower.Pos.m_row; int _col = _follower.Pos.m_col; _follower.SetPosition(_row + 2, _col - 2); } IntEventArgs _args = new IntEventArgs(m_step); long _id = TimerManager.StartTimer(1500, false, _args, DelayDestroyXiangFollow, 0); m_timerIdList.Add(_id); ++m_step; } //else if(m_step == 3) //{ // for (int _i = 0; _i < m_followList.Count; ++_i) // { // Follower _follower = m_followList[_i].GetComponent<Follower>(); // int _row = _follower.Pos.m_row; // int _col = _follower.Pos.m_col; // _follower.SetPosition(_row + 2, _col + 2); // } // ++m_step; //} }
private void UseSkill() { SceneModule _sceneModule = (SceneModule)GameManager.GameManagerObj.GetComponent <GameManager>().GetModuleByName("SceneModule"); if (_sceneModule.isPlayerReady() && m_count > 0) { IntEventArgs args = new IntEventArgs((int)m_id); EventManager.SendEvent(HLEventId.USE_SKILL, args); } }
private void Update() { if (Input.GetMouseButton(0) && m_move && m_skillId != SkillId.NONE) { Ray _ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit _hit; int _layerMask = 1 << 8; if (Physics.Raycast(_ray, out _hit, 100, _layerMask)) { if (_hit.collider.gameObject.tag.Equals("Plane")) { MapData _data = _hit.transform.GetComponent <MapData>(); if (CheckCanMove(_data.Pos.m_row, _data.Pos.m_col, _data.Data)) { if (GameManager.SceneConfigId == 0) { RookieModule _rookieModule = (RookieModule)GameManager.GameManagerObj.GetComponent <GameManager>().GetModuleByName("RookieModule"); _rookieModule.RefreshMap(); } else { SceneModule _sceneModule = (SceneModule)GameManager.GameManagerObj.GetComponent <GameManager>().GetModuleByName("SceneModule"); _sceneModule.RefreshMap(); } IntEventArgs args = new IntEventArgs((int)m_skillId); EventManager.SendEvent(HLEventId.PLAYER_START_MOVE, args); m_state = State.Move; float _targetPosX = _data.Pos.m_row * DiffX; float _targetPosZ = _data.Pos.m_col * DiffZ; if (m_skillId == SkillId.JU) { MissionList.Instance.jutimes++; MissionList.Instance.Judgemission(); Sequence _sequence = DOTween.Sequence(); _sequence.Append(transform.DOMove(new Vector3(_targetPosX, this.transform.position.y, _targetPosZ), 0.4f).SetEase(m_juCurve)); _sequence.AppendCallback(MoveEnd); _sequence.SetAutoKill(true); } else if (m_skillId == SkillId.MA || m_skillId == SkillId.PAO) { MissionList.Instance.matimes++; MissionList.Instance.Judgemission(); float _targetPosY = 0f; if (_data.Data == MapDataType.GAOTAI) { _targetPosY = 1.0f; } float _midTargetPosX = 0.0f; float _midTargetPosZ = 0.0f; if (_data.Pos.m_row == m_playerPos.m_row + 2) { _midTargetPosX = (m_playerPos.m_row + 1) * DiffX; _midTargetPosZ = this.transform.position.z; } else if (_data.Pos.m_row == m_playerPos.m_row - 2) { _midTargetPosX = (m_playerPos.m_row - 1) * DiffX; _midTargetPosZ = this.transform.position.z; } else if (_data.Pos.m_col == m_playerPos.m_col + 2) { _midTargetPosX = this.transform.position.x; _midTargetPosZ = (m_playerPos.m_col + 1) * DiffZ; } else if (_data.Pos.m_col == m_playerPos.m_col - 2) { _midTargetPosX = this.transform.position.x; _midTargetPosZ = (m_playerPos.m_col - 1) * DiffZ; } Sequence _sequence = DOTween.Sequence(); _sequence.Append(transform.DOMove(new Vector3(_midTargetPosX, this.transform.position.y, _midTargetPosZ), 0.3f).SetEase(m_maCurve1)); _sequence.Append(transform.DOJump(new Vector3(_targetPosX, _targetPosY, _targetPosZ), 0.4f, 1, 0.3f).SetEase(m_maCurve2)); _sequence.AppendCallback(MoveEnd); _sequence.SetAutoKill(true); } else if (m_skillId == SkillId.XIANG) { MissionList.Instance.xiangtimes++; MissionList.Instance.Judgemission(); float _targetPosY = 0f; if (_data.Data == MapDataType.GAOTAI) { _targetPosY = 1.0f; } Sequence _sequence = DOTween.Sequence(); _sequence.Append(transform.DOJump(new Vector3(_targetPosX, _targetPosY, _targetPosZ), 0.4f, 1, 0.5f).SetEase(m_xiangCurve)); _sequence.AppendCallback(MoveEnd); _sequence.SetAutoKill(true); } m_skillId = SkillId.NONE; m_playerPos.m_row = _data.Pos.m_row; m_playerPos.m_col = _data.Pos.m_col; } } } } }