When I run this code,error CS0120: An object reference is required to access non-static member `UnityEngine.Component.gameObject’ error appears.
I am new at Unity and C#. So, I could not have any idea about solving this problem.
What can I solve this problem?
(not: I am working with Phidget RFID on Unity3d.)
static void rfid_Tag(object sender, TagEventArgs e)
{
Debug.Log("Tag “+ e.Tag+ " scanned”);
if (e.Tag == “0107ee83c1”) {
gameObject.renderer.material.color = Color.green;
}
}
}