Example #1
0
    void Awake()
    {
        guard = GetComponent <UnityEngine.AI.NavMeshAgent>();
        guard.updateRotation = false;

        guard_motor = GetComponent <BotFreeMovementMotor>();

        botNav = GetComponent <BotNavigation>();

        _transform = transform;


        state = State.Patrol;

        raycastLayerMask = ~raycastLayerMask;
    }
Example #2
0
    void Awake()
    {
        guard = GetComponent <NavMeshAgent>();
        guard.updateRotation = false;

        guard_motor = GetComponent <BotFreeMovementMotor>();

        botNav = GetComponent <BotNavigation>();

        _transform = transform;

        //Explicitly set state so that we call the EnterState method
        state = State.Patrol;

        raycastLayerMask = ~raycastLayerMask;
    }
 void OnEnable()
 {
     botNav = target as BotNavigation;
 }