StartPatrol() public method

public StartPatrol ( ) : void
return void
Example #1
0
    void SpawnPolice()
    {
        int        spawnPointIndex = Random.Range(0, SpawnPointsPolice.Count);
        GameObject police          = Instantiate(Police, SpawnPointsPolice[spawnPointIndex].position,
                                                 SpawnPointsPolice[spawnPointIndex].rotation);

        // set variables of police
        Patrol policePatrol = police.GetComponent <Patrol>();

        policePatrol.moveSpots    = GameManager.instance.MoveSpots;
        policePatrol.playerTarget = player.transform;
        policePatrol.StartPatrol();
    }
Example #2
0
    void UpdateBehaviour()
    {
        previousPhase = enemyPhase; // Ensure that enemyPhase and previousPhase are once again in sync.

        switch (enemyPhase)
        {
        case Phase.PATROL:     // TO FIX: Enemy speed issue here. Movement speed above 4 causes enemy to stop. Tweak REST_DISTANCE on the Patrol script.
            _musicManager.Condition = MusicManager.Conditions.Normal;
            AlterFlashlightColourDebug(Color.white);
            patrolRoute.StartPatrol();
            break;

        case Phase.VIGIL:
            break;

        case Phase.HALT:
            StartCoroutine("Halt");
            break;

        case Phase.INVESTIGATE:
            StopCoroutine("Halt");
            movement.SetWalkTarget(disturbanceZone);
            break;

        case Phase.ALERT:
            if (NuclearMode)
            {
                SceneManager.LoadScene("MissionFailed");
            }
            else
            {
                StartCoroutine("Alert");
            }
            break;

        case Phase.DECEASED:
            // For Adrian - I still have to implement the enemy's death, but a "death" sound would be used somewhere here.

            Flashlight.enabled = false;     // For Adrian - Whenever the enemy's flashlight is switched on or off, we could play a little "click" sound.
            break;
        }
    }