예제 #1
0
 void PoliceCarMode_Change()
 {
     if (difference >= 10 && difference <= 30)
     {
         Debug.Log("Mode Changing");
         currentMode = PoliceCarMode.Aggressive;
         Invoke("PoliceCarMode_PreviousMode", 2.0f);
     }
 }
예제 #2
0
    void OnEnable()
    {
        PoliceCar_Back();
        thisTrans = transform;         // coping the game object transform values in to a local value

        playercarScript = GameObject.FindGameObjectWithTag("Player").GetComponent <playerCarControl> ();

        currentState = PoliceCarState.OnRoad;              // to start police car state on road

        currentMode = PoliceCarMode.Avoid;                 // to start police car with avid Mode

        PoliceCar_Back();                                  //

        InvokeRepeating("PoliceCarMode_Change", 10f, 20f); // police car mode changing here

        policeCarSound.volume = 0.3f;
    }
예제 #3
0
 void PoliceCarMode_PreviousMode()
 {
     currentMode = PoliceCarMode.Avoid;
 }