Hi,
I have a single empty object, Update Manager, with a single script attached, also named Update Manager.
It has an Awake function that does work, just a few bits like this for the most part:
LevelManager = GameObject.Find("LevelManager");
LevelManagerScript = LevelManager.GetComponent<LevelManager>();
The Start() function is also straightforward:
void Start() {
CompanyManager = new CompanyManager();
//set Tick length and timer details
tickLength = 1000; // in nanoseconds
if(tickLength < 1000) //if tickLength is too short, then set TurnBased to true and proceed
{
isTurnBased = true;
activateUI(EndTurnCanvasGroup);
} else
{
timer = new System.Timers.Timer();
timer.Interval = tickLength;
timer.Elapsed += new ElapsedEventHandler(OnTick);
timer.Enabled = true;
}
}
My problem is that this extremely simple object with what seems like extremely simple code attached is somehow instantiated 3 times, despite only existing once.
What could have gone wrong? What should I start testing?