Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nastajus/ca162caf0dd413296576 to your computer and use it in GitHub Desktop.
Save nastajus/ca162caf0dd413296576 to your computer and use it in GitHub Desktop.
how do I surpass this error? I don't understand what I'm doing wrong. Also tried simply Find(go) but nope to that also. error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
public void RemoveUserGO(GameObject go){
int i = UserCreatedGOs.FindIndex( (GameObject obj) => obj.GetInstanceID = go.GetInstanceID );
UserCreatedGOs.RemoveAt(i);
//...do more with i
}
public void RemoveUserGO(GameObject go){
int i = UserCreatedGOs.FindIndex( obj => obj.GetInstanceID = go.GetInstanceID );
UserCreatedGOs.RemoveAt(i);
//...do more with i
}
@nastajus
Copy link
Author

nastajus commented Jun 3, 2014

  1. Use == instead, i.e. Blah => herp == derp
  2. Get this: error CS0019: Operator ==' cannot be applied to operands of typemethod group' and `method group'
  3. Notice that GetInstanceID is a method
  4. Use () instead: Blah => herp() == derp()

Incidentally here's the definition of method group... http://stackoverflow.com/questions/886822/what-is-a-method-group-in-c
Solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment