Ejemplo n.º 1
0
    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));
        }
    }
Ejemplo n.º 2
0
    void Start()
    {
        myShopMover = GetComponent <ShopMover> ();

        startPosition = myShopMover.GetPosition();

        StartCoroutine(BasicCustomerRoutine());
    }
 void Awake()
 {
     myShopMover = GetComponent <ShopMover> ();
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     mover = GetComponent <ShopMover> ();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Places the given ShopMover in the spawn position.
 /// </summary>
 /// <param name="customer">Customer.</param>
 public void SpawnCustomer(ShopMover customer)
 {
     customer.SetPosition(spawnPosition);
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     shopMover    = GetComponent <ShopMover> ();
     nextMoveTime = Time.time;
     isMoving     = false;
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     myShopMover = GetComponent <ShopMover> ();
     myCharacter = GetComponent <ICharacter> ();
 }