public void MoveToClosestEdge(bool fullspeed = true) { NavMeshHit hit; NavMeshAgentComponent.FindClosestEdge(out hit); BotComponent.UnFocus(); BotComponent.FocusOnPosition(hit.position); MoveTowardsPosition(fullspeed); MoveToPosition(StopMovementConditions.WITHIN_PERSONAL_SPACE, fullspeed); }
public Vector3?JumpOffLedge(bool fullspeed = false) { RaycastHit rayhit; if (CanJumpDown(out rayhit)) { BotComponent.UnFocus(); BotComponent.FocusOnPosition(rayhit.point); MoveToPosition(StopMovementConditions.AT_POSITION, fullspeed); return(rayhit.point); } return(null); }
public override void MoveTowardsPosition(bool fullspeed = true) { RotateTowardsPosition(); if (Mathf.RoundToInt(BotComponent.FocusedOnPosition.Value.y) > Mathf.RoundToInt(transform.position.y)) { Flying3DObjectComponent.ApplyVerticalThrust(true); } if (Mathf.RoundToInt(BotComponent.FocusedOnPosition.Value.y) < Mathf.RoundToInt(transform.position.y)) { Flying3DObjectComponent.ApplyVerticalThrust(false); } if (!BotComponent.IsWithinInteractionDistance()) { Flying3DObjectComponent.ApplyForwardThrust(fullspeed ? 1f : 0.2f); } else if (BotComponent.IsWithinPersonalSpace()) { Flying3DObjectComponent.ApplyForwardThrust(fullspeed ? -0.5f : 0.1f); } }
bool reachedDestination() { return((m_stopMovementCondition == StopMovementConditions.WITHIN_PERSONAL_SPACE && BotComponent.IsWithinPersonalSpace()) || (m_stopMovementCondition == StopMovementConditions.WITHIN_INTERACTION_DISTANCE && BotComponent.IsWithinInteractionDistance()) || (m_stopMovementCondition == StopMovementConditions.AT_POSITION && transform.position == BotComponent.FocusedOnPosition.Value)); }
public void MoveTowardsTarget(bool fullspeed = true) { BotComponent.FocusOnPosition(BotComponent.FocusedOnTransform.position); MoveTowardsPosition(fullspeed); }