Beispiel #1
0
 private void OnMouseDown()
 {
     if (!manager.active)
     {
         manager.ActivateCurve();
     }
 }
    public void SpawnCar()
    {
        currentManager?.DeactivateCurve();

        //instantiate manager
        GameObject newCurve = Instantiate(carManager);
        //get spawn manager componenet
        CarSystem curveManager = newCurve.GetComponent <CarSystem>();

        //set car prefab
        curveManager.carPrefab = cars[carSelectionDropdownUI.value];
        //set manager to this
        curveManager.curveSpawner = this;
        //set gizmo camera
        curveManager.gizmoCamera = gizmoCamera;
        //enable manager
        curveManager.ActivateCurve();
        //add to list of current managers
        managers.Add(newCurve);
    }