private void AddToInfo(Building building) { buildings[building.name].Add(building); PopupController.CreateFloatingText(string.Format("{0} +{1}", building.name, building.score), Color.yellow, 20); // If already exists add score to current info for (int i = 0; i < info.Count; i++) { if (info[i].nameText.text == building.name) { info[i].amountText.text = buildings[building.name].Count.ToString(); int score = 0; for (int j = 0; j < buildings[building.name].Count; j++) { score += buildings[building.name][j].score; } info[i].scoreText.text = score.ToString(); return; } } // Create info CreateInfo(building); }
public float AddMultiplier(Block block) { switch (block) { case Block.Perfect: multiplier += Perfect; PopupController.CreateFloatingText("Perfect", blue); AudioSystem.Instance.PlayStackSound(true); break; case Block.Good: multiplier += Good; PopupController.CreateFloatingText("Good", green); AudioSystem.Instance.PlayStackSound(true); break; case Block.Ok: multiplier += Ok; PopupController.CreateFloatingText("Ok", yellow); AudioSystem.Instance.PlayStackSound(false); break; case Block.Bad: multiplier = 1; AudioSystem.Instance.PlayStackSound(false); break; default: multiplier = 1; Debug.LogError("Case Block." + block.ToString() + " was not handled."); break; } return(multiplier); }