Ejemplo n.º 1
0
 public static MonsterMoveState GetInstance()
 {
     if (instance == null)
     {
         instance = new MonsterMoveState();
     }
     return(instance);
 }
Ejemplo n.º 2
0
 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());
         }
     }
 }