FG28_Kodiak I tried this with a number of other changes but I keep getting the following server error.
The name 'action' does not exist in the current context.
I have looked at other coding and can not see the problem.
Code:
base.OnTrigger(missionNumber, shortName, active);
List<string> ActionToDoList = new List<string>{"action17", "action18", "action19", "action20", "action21", "action22"};
if ("G17".Equals(shortName) && active)
{
ActionToDoList.ForEach(item =>
{
if (action != null)
{
action.Do();
}
});
}
and if I use this code I get another error saying Invalid expression term 'if'
Code:
List<string> ActionToDoList = new List<string>{"action17", "action18", "action19", "action20", "action21", "action22"};
if ("G17".Equals(shortName) && active)
{
ActionToDoList.ForEach(item =>
if (action != null)
{
action.Do();
}
});