示例#1
0
        public void OnStateEnter()
        {
            Chat.WriteLine("MoveToQuestGiverState::OnStateEnter");

            if (!IsAtQuestGiver())
            {
                Vector3 randoPos = Constants.QuestGiverPos;
                randoPos.AddRandomness(Entropy);

                int randomWait = Utils.Next(MinWait, MaxWait);
                Chat.WriteLine($"Idling for {randomWait} seconds..");
                Task.Delay(randomWait * 1000).ContinueWith(x =>
                {
                    Chat.WriteLine("Moving to quest giver");

                    try
                    {
                        InfBuddy.NavMeshMovementController.SetNavMeshDestination(randoPos);
                    }
                    catch (Exception e)
                    {
                        InfBuddy.NavMeshMovementController.SetDestination(Constants.WallBugFixSpot);
                        InfBuddy.NavMeshMovementController.AppendNavMeshDestination(randoPos);
                    }
                }, _cancellationToken.Token);
            }
        }
示例#2
0
        public void HoldPosition()
        {
            if (!InfBuddy.NavMeshMovementController.IsNavigating && !IsNearDefenseSpot())
            {
                Vector3 randomHoldPos = _holdPos;
                randomHoldPos.AddRandomness(_entropy);

                InfBuddy.NavMeshMovementController.SetNavMeshDestination(randomHoldPos);
            }
        }