IEnumerator FindLocalPlayerControl() { yield return(new WaitForSeconds(3.0f)); playerInput = GameObject.Find("GameState").GetComponent <GameStateManager> ().GetLocalPlayer().GetComponent <PlayerControl> ().input; if (playerInput == null) { StartCoroutine(FindLocalPlayerControl()); } }
IEnumerator FindLocalPlayerControl() { yield return new WaitForSeconds (3.0f); playerInput = GameObject.Find ("GameState").GetComponent<GameStateManager> ().GetLocalPlayer ().GetComponent<PlayerControl> ().input; if (playerInput == null) StartCoroutine(FindLocalPlayerControl ()); }