예제 #1
0
 public override AIStateType onThink()
 {
     if (getMonsterAIComponent().hasState(AIStateType.DROWNING) && isInWater())
     {
         return(AIStateType.DROWNING);
     }
     _checkTargetType = checkTarget();
     if (_checkTargetType != AIStateType.NONE)
     {
         return(_checkTargetType);
     }
     this._roamComponent.onRoam();
     if (this._roamType != this._roamComponent.getRoamType())
     {
         this._roamType = this._roamComponent.getRoamType();
         if (this._roamType == RoamType.WALK)
         {
             this._roamComponent.setRoamCenterPoint(this._host.transform.position);
         }
     }
     this._roamTime--;
     if (this._roamTime <= 0)
     {
         return(AIStateType.FREE);
     }
     return(AIStateType.NONE);
 }
예제 #2
0
 public void reset()
 {
     stopMove();
     this._centerPoint.Set(0, 0, 0);
     this._moveType    = MoveType.WALK;
     this._roamRadius  = 0;
     this._idelTime    = 0;
     this._roamType    = RoamType.IDLE;
     this._currentTime = 0;
 }
예제 #3
0
        public override void stateIn()
        {
            base.stateIn();

            GameObject host = this._npcAIComponent.host();

            this._roamType = RoamType.WALK;
            this._roamTime = 500;
            this._roamComponent.setRoamCenterPoint(this._host.transform.position);
            this._roamComponent.setRoamParams(20, 0, 1);
            this._roamComponent.setRoamType(this._roamType);
        }
예제 #4
0
        public override void stateIn()
        {
            base.stateIn();
            this._roamComponent.setMoveType(MoveType.LODGED);
            _state = 1;
            GameObject host = getMonsterAIComponent().host();

            this._roamTime = getMonsterAIComponent().monsterAIData.roamTime;
            this._roamType = RoamType.LODGED;

            this._roamComponent.setRoamCenterPoint(this._host.transform.position);
            this._roamComponent.setRoamParams(getMonsterAIComponent().monsterAIData.maxRoamDis, getMonsterAIComponent().monsterAIData.roamIdelTime, getMonsterAIComponent().monsterAIData.minRoamDis);
        }
예제 #5
0
 public virtual void setRoamType(RoamType type)
 {
     this._roamType = type;
     if (this._roamType == RoamType.WALK)
     {
         onStartWalk();
     }
     else if (this._roamType == RoamType.IDLE)
     {
         this._currentTime = 0;
         onStartIdle();
     }
     else if (this._roamType == RoamType.LODGED)
     {
         onSpecialRoam();
     }
 }
예제 #6
0
 public override AIStateType onThink()
 {
     this._roamComponent.onRoam();
     if (this._roamType != this._roamComponent.getRoamType())
     {
         this._roamType = this._roamComponent.getRoamType();
         if (this._roamType == RoamType.WALK)
         {
             this._roamComponent.setRoamCenterPoint(this._host.transform.position);
         }
     }
     this._roamTime--;
     if (this._roamTime <= 0)
     {
         return(AIStateType.FREE);
     }
     return(AIStateType.NONE);
 }