Search Unity

InvalidProgramException: Invalid IL code ???

Discussion in 'Entity Component System' started by shotoutgames, Oct 4, 2020.

  1. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    This worked until two hours ago.
    I added stuff to the foreach and it worked and at some point I received this error.
    So I started deleting and still get the error with this simple code below.
    I reinstalled. Reset the project. Changed file names, update orders and more.
    At a lost.
    Bug??
    InvalidProgramException: Invalid IL code in WinnerSystems:OnUpdate (): IL_008d: brfalse IL_00a1



    Code (CSharp):
    1.   protected override void OnUpdate()
    2.     {
    3.         int goal = 1;
    4.  
    5.         Entities.ForEach
    6.         (
    7.             (Entity e
    8.             ) =>
    9.             {
    10.  
    11.                 goal = 2;
    12.  
    13.             }
    14.         ).Run();
    15.  
    16.  
     
  2. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    ever figure it out - ive heard change the foreach to a for loop