Ok so I made a code that includes string/int arrays with some for loops. In my code there is a part where it counts more than 1 of the string but how do you make the string plural when there is more than one? Here's a part of the code that I'm talking about:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VoidFunctions : MonoBehaviour
{
public string[] Enemies = {"Ghoul", "Skeleton", "Zombie"};
public int[] enemyCount = {1, 2, 2};
public virtual void Start()
{
for (int i = 0; i < Enemies.Length; i++)
{
Fight(Enemies[i], enemyCount[i]);
}
}
void Fight(string enemy, int amount)
{
print(this.name + " encountered a " + enemy);
print(this.name + " killed " + amount + " " + enemy);
}
}
So for the second string "Skeleton", there is 2 killed but it comes out "killed 2 Skeleton"...how do you make it plural?
Enemyclass instead of trying to track every enemy property with independent arrays.