void SpawnResourceParticle(GameEngine.ResourceType resource, int quantity) { Debug.Log(string.Format("Spawning particle for {0} with quantity {1}", resource.ToString(), quantity)); ObjectPooler.Current.Spawn <ResourceGainParticle>("ResourceGainParticle", x => { x.Source = this.transform.position; x.Destination = GameEngine.Current.ResourceDisplays[(int)resource].GetWorldPosition(); x.Resource = resource; x.PercentTraveled = 0; x.Quantity = quantity; x.SetSprite(); }); }
public void AddResource(GameEngine.ResourceType resource, int amount) { if (!Ingredients.ContainsKey(resource)) { Ingredients[resource] = 0; } Ingredients[resource] += amount; if (amount > 0) { SoundBoard.Current.PlayIngredientAdded(); StartCooking(); } UpdateGriddleUI(); }
public void Populate(GameEngine.ResourceType resource, int quantity) { IngredientIcon.sprite = GameEngine.Current.IngredientIcons[(int)resource]; CountText.text = quantity.ToString(); }