public void ActivateThrowBackButtons(KidMover kidMover) { foreach (GameObject throwBackButton in gameRef.throwBackButtons) { throwBackButton.SetActive(true); } fetchedKid = kidMover; }
IEnumerator Spawn() { yield return(new WaitForSeconds(2.0f)); while (true) { GameObject kid = gameRef.kids [Random.Range(0, gameRef.kids.Length)]; float[] x_values = { -5.1900f, 5.1900f }; float x_value = x_values [Random.Range(0, x_values.Length)]; Vector3 spawnPosition = new Vector3( x_value, 0.62f, 0.0f ); Quaternion spawnRotation = Quaternion.identity; Instantiate(kid, spawnPosition, spawnRotation); KidMover kidMover = kid.gameObject.GetComponent <KidMover>(); kidMover.gameRef = gameRef; Debug.Log("Kid coming"); yield return(new WaitForSeconds(Random.Range(10.0f, 15.0f))); } }