void SpawnMissFloatingText(Projectile projectile) { FloatingText floatingText = SimplePool.Spawn(FloatingTextPrefab).GetComponent <FloatingText>(); floatingText.transform.position = projectile.transform.position; floatingText.Color(MissColor); floatingText.Text("MISS"); floatingText.StartMoving(); }
void SpawnFoodFloatingText(int amount, int food, Transform trans) { string mark = ""; if (amount > 0) { mark = "+"; } FloatingText floatingText = SimplePool.Spawn(FloatingTextPrefab).GetComponent <FloatingText>(); floatingText.transform.position = trans.position; floatingText.Color(FoodColor); floatingText.Text(mark + amount); floatingText.Icon(FoodIconSprite, FoodColor); floatingText.StartMoving(); }
void SpawnFoodFloatingText(Unit unit) { Mob mob = unit as Mob; if (mob == null) { return; } if (mob.FoodReward < 1) { return; } FloatingText floatingText = SimplePool.Spawn(FloatingTextPrefab).GetComponent <FloatingText>(); floatingText.transform.position = unit.transform.position; floatingText.Color(FoodColor); floatingText.Text("+" + mob.FoodReward); floatingText.StartMoving(); }