Пример #1
0
    void Update()
    {
        if (IsMoving)
            return;

        if (Input.GetKeyDown(KeyCode.A))
        {
            Enabled = !Enabled;
            if (Enabled)
                ActivateAutoNavigation();
            else
                ActivateManualNavigation();
        }

        if (Enabled)
        {
            TargetedKeyPoint = ClosestKeypoint(true);
            if (TargetedKeyPoint != null && MiddleVR.VRDeviceMgr.IsWandButtonToggled(0, true))
                ChoosePath();
        }
    }
Пример #2
0
 void StopWalking()
 {
     IsMoving = false;
     if (AdjacentsKeyPoints.Count == 1)
     {
         TargetedKeyPoint = ClosestKeypoint(false);
         if (TargetedKeyPoint != null)
             ChoosePath();
     }
 }