// 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++; } }
public void AddCasualCustomer(CasualCustomer customer) { context.CasualCustomers.Add(customer); context.SaveChanges(); }