Пример #1
0
        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);
            }
        }
Пример #2
0
 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));
 }