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); }
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; }
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); }
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); }
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(); } }
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); }