Answer by LoneMonkey
Not exactly for sure how this would be done without putting my thinking hat on but as a quick alternative you could call a function on the Lights script from the Switch script passing the correct...
View ArticleAnswer by Guidanel
It's not really an answer to your question but with your example shouldn't you give references of your 3 lights to your Switch script? This way it can set the lights on and off immediately depending on...
View ArticleAnswer by NewPath
What you are looking for is achieved through reflection. The caveat is this only works with public properties or members. public bool RedLight { get; set; } private void SetLight(string name, bool...
View ArticleAnswer by LoneMonkey
Not exactly for sure how this would be done without putting my thinking hat on but as a quick alternative you could call a function on the Lights script from the Switch script passing the correct...
View ArticleAnswer by GiyomuGames
It's not really an answer to your question but with your example shouldn't you give references of your 3 lights to your Switch script? This way it can set the lights on and off immediately depending on...
View ArticleAnswer by NewPath
What you are looking for is achieved through reflection. The caveat is this only works with public properties or members. public bool RedLight { get; set; } private void SetLight(string name, bool...
View Article