I have a module public GameObject FlipCardAndUpdatedMasterList(GameObject cardToFlip_GO) { that i successfully call from different modules in the same script.
This is an example of that:
if (selected_GameObject.tag != "Dummy_GameObject")
selected_GameObject = FlipCardAndUpdatedMasterList(selected_GameObject);
When i try to call with the following code (below), from another function in the same script i get the following error:CS0120: An object reference is required to access non-static member `GameEngine_Script.FlipCardAndUpdatedMasterList(UnityEngine.GameObject)'
List<GameObject> myList = new List<GameObject> (Singleton.Instance.master_GameObject_List);
foreach (GameObject aGO in myList) {
// Check if back is up and fix if needed
if (aGO.tag.LastIndexOf ("B") == -1) { // Back is up
} else {
GameObject myGO = FlipCardAndUpdatedMasterList(aGO);
}
}
Could someone please explain what is wrong and what the difference is?