public DealerRepresentative()
 {
     _delivery     = new PizzaDelivery();
     _finance      = new PizzaFinance();
     _insurance    = new PizzaInsurance();
     _order        = new PizzaOrder();
     _registration = new PizzaRegistration();
     _service      = new PizzaCooking();
 }
예제 #2
0
    void Start()
    {
        playerTruck         = GameObject.FindObjectOfType <DeliveryTruck>();
        lost                = false;
        gameTimer           = timer_max;
        deliveriesRemaining = 0;
        timeElapsedThisGame = 0f;
        LoadLeaderboard();

        //foreach (GameRecord g in gameRecords)
        //print(g.GetDescription());

        possibleDeliveries = new List <GameObject>();
        pizzaDeliveries    = new List <PizzaDelivery>();
        enemies            = new List <GameObject>();

        //get each possible delivery and add it to a list, and add a number of deliveries at random using the possibilities

        foreach (GameObject poss in GameObject.FindGameObjectsWithTag("PossibleDelivery"))
        {
            possibleDeliveries.Add(poss);
        }

        for (int i = 0; i < deliveriesToSpawn; i++)
        {
            GameObject poss = possibleDeliveries[Random.Range(0, possibleDeliveries.Count - 1)];
            possibleDeliveries.Remove(poss);
            PizzaDelivery newPD = Instantiate(pizzaDeliveryPrefab, poss.transform.position, poss.transform.rotation) as PizzaDelivery;
            //newPD.launchTarget.position = poss.GetComponent<PossibleDelivery>().GetLaunchPosition();
            newPD.pizzasOrdered = Random.Range(1, 5);
            pizzaDeliveries.Add(newPD);
            deliveriesRemaining++;
        }

        cash = 0;
        enemySpawnCounter = enemySpawnInterval;
    }