// Use this for initialization void Start() { m_curSceneId = 1; //NetSessionMgr.GetInstance().Init(); NavigationMgr.GetInstance().init(MapOrigin); CCearcueMgr.GetInstance().Init(); if (m_curSceneId == GameDefine.FightSceneID) { CCearcueMgr.GetInstance().setTerrian(Terrian); CCearcueMgr.GetInstance().CreateCearcue(1, CCearcueType.Terrian); CCearcueMgr.GetInstance().setPlayer(monster4); CCearcueMgr.GetInstance().CreateCearcue(1, CCearcueType.Player); CCearcueMgr.GetInstance().testMonster1 = monster1; CCearcueMgr.GetInstance().testMonster2 = monster2; CCearcueMgr.GetInstance().testMonster3 = monster3; //CCearcueMgr.GetInstance().testMonster4 = monster4; CCearcueMgr.GetInstance().CreateCearcue(1001, CCearcueType.Monster); CCearcueMgr.GetInstance().CreateCearcue(1002, CCearcueType.Monster); CCearcueMgr.GetInstance().CreateCearcue(1003, CCearcueType.Monster); //CCearcueMgr.GetInstance().CreateCearcue(1004, CCearcueType.Monster); } if (isOutPutMap) { NavigationMgr.GetInstance().ImportMapData(); } }
void RunOver() { EventMessageBase message = new EventMessageBase(); message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVEOVER; message.eventMessageModel = EventMessageModel.eEventMessageModel_PLAY_MOVE_STATE; CCearcueMgr.GetInstance().player.OnMessage(message); }
void Hero_Injurt() { EventMessageBase message = new EventMessageBase(); message.eventMessageModel = EventMessageModel.eEventMessageModel_PLAY_ATTACK_STATE; message.eventMessageAction = 20; CCearcueMgr.GetInstance().MonsterBeAttack(CCearcueMgr.GetInstance().player.GetAttackArea(), message); }
void MonAttOver() { EventMessageBase message = new EventMessageBase(); message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_FIGHT_FINISH; message.eventMessageModel = EventMessageModel.eEventMessageModel_PLAY_STATE; CCearcueMgr.GetInstance().player.OnMessage(message); }
void Hero_Injurt() { EventMessageBase message = new EventMessageBase(); message.eventMessageAction = 5; message.eventMessageModel = EventMessageModel.eEventMessageModel_PLAY_STATE; CCearcueMgr.GetInstance().player.OnMessage(message); }
void injurtOver() { EventMessageBase message = new EventMessageBase(); message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_FIGHT_FINISH; message.eventMessageModel = EventMessageModel.eEventMessageModel_MONSTER_STATE; message.modleId = int.Parse(this.name); CCearcueMgr.GetInstance().MonsterOnMessage(message); }
// Update is called once per frame void Update() { if (isDebug) { NavigationMgr.GetInstance().showGrid(); NavigationMgr.GetInstance().showObstacleGrid(); } CCearcueMgr.GetInstance().Update(Time.deltaTime); }
public void Execute(CMonster type, float time) { type.GetRenderObject().transform.LookAt(CCearcueMgr.GetInstance().player.GetRenderObject().transform.localPosition); type.GetRenderObject().transform.Translate(Vector3.forward * CMonsterCommon.MoveSpeed * time); if (NavigationMgr.GetInstance().GetGrid().GetDistance(CCearcueMgr.GetInstance().player.PositionInPathGrid, type.PositionInPathGrid) > CMonsterCommon.eyeArea) { type.m_stateMachine.ChangeState(MonsterIdelState.GetInstance()); } else if (NavigationMgr.GetInstance().GetGrid().GetDistance(CCearcueMgr.GetInstance().player.PositionInPathGrid, type.PositionInPathGrid) <= CMonsterCommon.AttackArea) { type.m_stateMachine.ChangeState(MonsterIdelState.GetInstance()); } }
public void Execute(CMonster type, float time) { if (NavigationMgr.GetInstance().GetGrid().GetDistance(CCearcueMgr.GetInstance().player.PositionInPathGrid, type.PositionInPathGrid) <= CMonsterCommon.eyeArea && NavigationMgr.GetInstance().GetGrid().GetDistance(CCearcueMgr.GetInstance().player.PositionInPathGrid, type.PositionInPathGrid) > CMonsterCommon.AttackArea) { type.m_stateMachine.ChangeState(MonsterMoveState.GetInstance()); } else if (NavigationMgr.GetInstance().GetGrid().GetDistance(CCearcueMgr.GetInstance().player.PositionInPathGrid, type.PositionInPathGrid) <= CMonsterCommon.AttackArea) { curCDTime += time; if (curCDTime >= CMonsterCommon.AttackCD) { curCDTime = 0; type.m_stateMachine.ChangeState(MonsterAttackState.GetInstance()); } } }
public void Enter(CMonster type) { type.GetRenderObject().transform.LookAt(CCearcueMgr.GetInstance().player.GetRenderObject().transform.localPosition); type.Play(MonsterAnimation.RUN, WrapMode.Loop); }
void MoveRight() { message.eventMessageModel = EventMessageModel.eEventMessageModel_PLAY_MOVE_STATE; message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVERIGHT; CCearcueMgr.GetInstance().player.OnMessage(message); }
void Attack() { message.eventMessageModel = EventMessageModel.eEventMessageModel_PLAY_ATTACK_STATE; message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_FIGHT; CCearcueMgr.GetInstance().player.OnMessage(message); }