public void AddBuyWorldDialogIngredient(Ingredient ingredientToAdd, GameObject pickup = null) { if (currentWorldDialog == null) { currentWorldDialog = Instantiate<WorldDialog>(worldDialogPrefab) as WorldDialog; currentWorldDialog.transform.SetParent(worldParent, false); currentWorldDialog.Init( "Click to buy an item!", WorldDialogType.Shop ); } Vector3 newpos = GameManager.main.Player.transform.position; newpos.y += 2.4f; currentWorldDialog.transform.position = newpos; currentWorldDialog.AddIngredient(ingredientToAdd, pickup); }
public void AddWorldDialogIngredient(Ingredient ingredientToAdd, GameObject pickup = null) { if (currentWorldDialog == null) { currentWorldDialog = Instantiate<WorldDialog>(worldDialogPrefab) as WorldDialog; currentWorldDialog.transform.SetParent(worldParent, false); currentWorldDialog.Init( "Press " + GameManager.main.PickupKey + " to pick up the items!", WorldDialogType.ItemPickup ); } if (pickup != null) { Vector3 newpos = pickup.transform.position; newpos.y += 2.4f; currentWorldDialog.transform.position = newpos; } currentWorldDialog.AddIngredient(ingredientToAdd, pickup); }