Ok I feel terrible having to ask people in the forum to figure this out for me. But it has been 5 days experimenting and I’m starting to go mad, yep cups of coffee thrown everywhere. So please help me with this, i’m only interested in doing this in C#. I have tried to use unity reference materials and wiki ect but their code seems to give me problems.
ALSO !!! if you have a paypal account I will send you some money, a little token of thank you for helping me. (the code that works well)
What I have is different regions eg Lisbon, Madrid, Paris ect. each object with their own name and script.
So attached to Lison object is a script called Lisbon example:
public class Lisbon : MonoBehaviour {
public static string Region = “Lisbon”;
public static string RegionOwner = “Portugal”;
public static int Population = 15000;
public static int PopulationGrowthRate = 2 ;
public static float ResidentialTaxRate = 20;
public static int RegionMoneyGrowth = 20;
public static int RegionID = 2;
void OnMouseDown()
{
mainInterface.RegionShow = Region;
mainInterface.RegionOwnerShow = RegionOwner;
mainInterface.PopulationShow= Population;
mainInterface.PopulationGrowthRateShow = PopulationGrowthRate;
mainInterface.ResidentialTaxRateShow = ResidentialTaxRate;
mainInterface.RegionMoneyGrowthShow = RegionMoneyGrowth;
mainInterface.RegionIDShow = RegionID;
}
}
madrid script is the same with different values ect
each object has a tag with “Portugal” which is the current owner. So madrid and lisbon has a tag called “Portugal”
I have a script called TurnCalc which I want to go through each object with TAG “Portugal” and get it’s Population value and then calculate them.
So in other words I when player clicks next turn the script called TurnCalc will go through each region and calculate the total population of each country. I hope that makes sence lol.
I have tried so many methods and I always get restricted by unity’s engine, there are so many I dont know where to begin. I think if I dont get this working soon I will have to purchase another engine. which would be a shame.
and please dont bother sending me links to unitys official manual and ref as I have hatred it. arrrhhh