Hi,
In one script file I have two prefabs that I instantiate individually based on certain conditions. Is it possible to pass these GameObjects in as Paramaters and instantiate them in a differently named script file?
Script File 1:
public class Player : MonoBehaviour {// Allow our PlayerClass awareness public GameObject Go1; public GameObject Go2; </p>
StartCoroutine(DoSomething(Go1, Go2)); }
Script File 2:
public class Player2 : MonoBehaviour { public int IEnumerator DoSomething(GameObject Go1, GameObject Go2) { // Do something with Go1 and Go2 return 0; // and return an int } }
Im getting parsing errors when trying to return an int, and object reference erros for the nonstatic field, method or properties.