For Context, I have a game where you can build settlements, and there is a script I have called SettlementBrain, which takes information from a static, non monobehaviour serializable class called SettlementStatistics, then the information that is processed gets sent to the GUI script for the settlement. Settler gameobjects have a tag called castaway, and the SettlementBrain counts these no problem to determine the amount of settlers. Here’s the problem: the settlers each have enums, which are on a non monobehaviour serializable class, to determine if they have settled or if they’re waiting for the player to find them and welcome them into the settlement. so the options for the enum are: castaway, settled, leftsettlement. The settlementBrain should, for each castaway tag they count, they should check the state of the enum. In theory, the brain will count how many settlers there are, and ignore the ones who are not settled. I hope this makes sense. Here is the code for the check settlement population function so far. I have only put in what i have so far. Thank you in advance to the community.
public void checkPopulation() { float Castaways = GameObject.FindGameObjectsWithTag("Castaway").Length; Debug.Log(Castaways); }