Exemplo n.º 1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        timeSinceLast += Time.deltaTime;

        if (timeSinceLast < timePerSpawn)
        {
            return;
        }

        timeSinceLast = 0;

        if (Random.Range(0, probOfCust) != 0)
        {
            return;
        }

        if (numCustomers < capacity)
        {
            GameObject     newCust     = Instantiate(customerPrefab, entrance, Quaternion.identity);
            CasualCustomer custControl = newCust.GetComponent <CasualCustomer>();
            custControl.spawner = this;
            numCustomers++;
        }
    }
Exemplo n.º 2
0
 public void AddCasualCustomer(CasualCustomer customer)
 {
     context.CasualCustomers.Add(customer);
     context.SaveChanges();
 }