예제 #1
0
 public int UpdateAI(float gameTime, float deltaTime)
 {
     if (gameTime > _nextTimeToGenMovingTarget)
     {
         _nextRequest = new AIBehaviorRequest(gameTime, new Vector3(Random.Range(-15f, 15f), 0, Random.Range(-15f, 15f)));
         _nextTimeToGenMovingTarget = gameTime + 20f + Random.Range(-5f, 5f);
     }
     return(0);
 }
예제 #2
0
        public int UpdateReqeust(float gameTime, float deltaTime)
        {
            if (_nextRequest != _currentRequest)
            {
                //reset bev tree
                _behaviorTree.Transition(_behaviorWorkingData);
                //assign to current
                _currentRequest = _nextRequest;

                //reposition and add a little offset
                //Vector3 targetPos = _currentRequest.nextMovingTarget + TMathUtils.GetDirection2D(_currentRequest.nextMovingTarget, transform.position) * 0.2f;
                //Vector3 startPos = new Vector3(targetPos.x, -1.4f, targetPos.z);
                //_targetDummyObject.transform.position = startPos;
                //LeanTween.move(_targetDummyObject, targetPos, 1f);
            }
            return(0);
        }