Example #1
0
 void Update()
 {
     if (myCamera == null && CameraScript.staticInstance != null)
     {
         myCamera = CameraScript.staticInstance.GetComponent <Camera>();
     }
     if (BetterNavNet.allNavPoints.Count > 0)
     {
         nearestNavPoint = BetterNavNet.FindNearestNavpoint(nearestNavPoint, transform.position);
     }
     ProcessRotation();
     ProcessMovement();
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.V))
     {
         isAIEnabled = true;
         nextAItime  = Time.time;
     }
     nearestNavPoint = BetterNavNet.FindNearestNavpoint(nearestNavPoint, this.transform.position);
     if (isAIEnabled)
     {
         AIScript();
     }
 }