private IEnumerator SpawningRoutine() { while (true) { GameObject customerObj = InstantiateACustomer(); if (customerObj != null) { ShopMover customer = customerObj.GetComponent <ShopMover> (); if (customer != null) { customerSpawner.SpawnCustomer(customer); } else { Debug.LogFormat("Customer object {0} does not have a ShopMover component and will not be spawned.", customerObj.name); } } else { Debug.Log("No customers to spawn!"); } yield return(new WaitForSeconds(7 + Random.value * 10)); } }
void Start() { myShopMover = GetComponent <ShopMover> (); startPosition = myShopMover.GetPosition(); StartCoroutine(BasicCustomerRoutine()); }
void Awake() { myShopMover = GetComponent <ShopMover> (); }
// Use this for initialization void Start() { mover = GetComponent <ShopMover> (); }
/// <summary> /// Places the given ShopMover in the spawn position. /// </summary> /// <param name="customer">Customer.</param> public void SpawnCustomer(ShopMover customer) { customer.SetPosition(spawnPosition); }
// Use this for initialization void Start() { shopMover = GetComponent <ShopMover> (); nextMoveTime = Time.time; isMoving = false; }
// Use this for initialization void Start() { myShopMover = GetComponent <ShopMover> (); myCharacter = GetComponent <ICharacter> (); }