mardi 6 juin 2017

Code stops executing after a method call

I am trying to set up a method for placing products into my store, and the code does not execute after I call a method. It does not throw any errors, it simply does not execute and I cannot figure out why. Heres where the code stops running:

public void AddProduct()
{
    List<StoreObjectReference> jars = db.GetProducts(StoreObjectReference.productType.jar);
    GameObject jar = Instantiate(jars[3].gameObject_);
    jar.AddComponent<Jar>();
    jar.GetComponent<Jar>().product = new StorageJar(jar);
    print("This prints");
    ProductPosition jarPosition = dm.dispensary.Storage_cs[0].GetRandomStorageLocation();
    print("This doesnt print");
    jar.transform.position = jarPosition.transform.position;
}

And heres the GetRandomStorageLocation()

public ProductPosition GetRandomStorageLocation()
{
    print("Getting product position"); // This prints
    return storageShelves[0].positions[0];
}




Aucun commentaire:

Enregistrer un commentaire