Example #1
0
    // 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();
        }
    }
Example #2
0
    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);
    }
Example #3
0
    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);
    }
Example #4
0
    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);
    }
Example #5
0
    void Hero_Injurt()
    {
        EventMessageBase message = new EventMessageBase();

        message.eventMessageAction = 5;
        message.eventMessageModel  = EventMessageModel.eEventMessageModel_PLAY_STATE;
        CCearcueMgr.GetInstance().player.OnMessage(message);
    }
Example #6
0
    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);
    }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        if (isDebug)
        {
            NavigationMgr.GetInstance().showGrid();
            NavigationMgr.GetInstance().showObstacleGrid();
        }

        CCearcueMgr.GetInstance().Update(Time.deltaTime);
    }
Example #8
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());
            }
        }
Example #9
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());
         }
     }
 }
Example #10
0
 public void Enter(CMonster type)
 {
     type.GetRenderObject().transform.LookAt(CCearcueMgr.GetInstance().player.GetRenderObject().transform.localPosition);
     type.Play(MonsterAnimation.RUN, WrapMode.Loop);
 }
Example #11
0
 void MoveRight()
 {
     message.eventMessageModel  = EventMessageModel.eEventMessageModel_PLAY_MOVE_STATE;
     message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVERIGHT;
     CCearcueMgr.GetInstance().player.OnMessage(message);
 }
Example #12
0
 void Attack()
 {
     message.eventMessageModel  = EventMessageModel.eEventMessageModel_PLAY_ATTACK_STATE;
     message.eventMessageAction = (int)EnitityCommon.EnitityAction.ENITITY_ACTION_FIGHT;
     CCearcueMgr.GetInstance().player.OnMessage(message);
 }