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