Beispiel #1
0
 private void onKeyDown(object sender, KeyEventArgs e)
 {
     if (debugMode && e.KeyCode == Keys.NumPad1)
     {
         UI.Notify(currentPlayerPosition.ToString());
         UI.Notify(currentStageLocation.ToString());
         UI.Notify(currentStageAction.ToString());
         UI.Notify(prevWantedLevel.ToString());
         if (wantedVehicleName != null)
         {
             UI.Notify(wantedVehicleName.ToString());
         }
         if (wantedVehicleColor != null)
         {
             UI.Notify(wantedVehicleColor.ToString());
         }
         if (Game.Player.Character.CurrentVehicle != null)
         {
             UI.Notify(Game.Player.Character.CurrentVehicle.PrimaryColor.ToString());
         }
         if (Game.Player.Character.CurrentVehicle != null)
         {
             UI.Notify(Game.Player.Character.CurrentVehicle.IsStolen.ToString());
         }
     }
     if (e.KeyCode == Keys.NumPad0)
     {
         mainMenu.Visible = !mainMenu.Visible;
     }
 }
Beispiel #2
0
    private void Start()
    {
        if (Home == null)
        {
            Home = SpawnController.SpawnPoints[Randoms.Next(0, SpawnController.SpawnPoints.Length)];
        }

        if (Home.IsBlocked)
        {
            Kill();
        }

        if (Destination == null)
        {
            Destination = SpawnController.DestinationPoints[Randoms.Next(0, SpawnController.SpawnPoints.Length)];
        }

        gameObject.transform.position = Home.transform.position;
        gameObject.transform.rotation = Home.transform.rotation;
        Routes        = GenerateRoutes(Home, Destination);
        SelectedRoute = GameConfig.UseDijkstra ? Routes.OrderBy(i => i.Weight).FirstOrDefault() : Routes.OrderBy(i => i.NodeCount).LastOrDefault();
        if (SelectedRoute == null)
        {
            Kill();
        }
        NextDestination = SelectedRoute.First();
        RunPath         = true;
        name            = VehicleColor.ToString();
        foreach (var r in gameObject.GetComponentsInChildren <MeshRenderer>())
        {
            r.material.shader = Shader.Find("_Color");
            r.material.SetColor("_Color", VehicleColor);
            r.material.shader = Shader.Find("Specular");
            r.material.SetColor("_SpecColor", VehicleColor);
        }

        SpawnController.Log += this + "\n";
    }
Beispiel #3
0
 public void ChangeColor(VehicleColor color)
 {
     Vehicle veh = Game.Player.Character.CurrentVehicle;
     veh.PrimaryColor = color;
     veh.SecondaryColor = color;
     UI.Notify("Change Color to " + color.ToString());
 }