Exemplo n.º 1
0
 // Update is called once per frame
 void LateUpdate()
 {
     if (!lineofsight.Spoted())
     {
         lineOfSightVisual.DrawFieldOfView();
         lineofsight.CurrFov   = lineofsight.Fov;
         lineofsight.CurrRange = lineofsight.range;
         LookPatrol();
         shooting1.endShooting();
     }
     else if (lineofsight.Spoted())
     {
         lineOfSightVisual.viewMesh.Clear();
         lineofsight.CurrRange = AlertedViewRange;
         lineofsight.CurrFov   = 110;
         shooting1.startShooting();
         shooting1.Point();
     }
 }
Exemplo n.º 2
0
    void Update()
    {
        if (!lineofsight.Spoted() && !onAlert)
        {
            lineOfSightVisual.DrawFieldOfView();
            lineofsight.CurrFov   = lineofsight.Fov;
            lineofsight.CurrRange = lineofsight.range;
            shooting1.endShooting();
            Patrol();
        }
        else if (lineofsight.Spoted() || onAlert)
        {
            MovRight = playerTrans.position.x > transform.position.x;
            lineOfSightVisual.viewMesh.Clear();
            lineOfSightVisual.viewMesh.Clear();
            lineofsight.CurrRange = AlertViewRange;
            lineofsight.CurrFov   = 110;
            shooting1.startShooting();
            shooting1.Point();
            chaseAI.Follow();
        }

        DetectWall();
    }