void Start() { spawnerObj = GameObject.Find("Spawner"); backGround = GameObject.Find("BackGround1"); resetScript = backGround.GetComponent <ScrollReset>(); treeScript = spawnerObj.GetComponent <TreeSpawn>(); swipeScript = spawnerObj.GetComponent <Swiper>(); }
// Use this for initialization void Start() { playerObj = GameObject.FindGameObjectWithTag("Player"); swiperScript = playerObj.GetComponent <Swiper>(); backGround = GameObject.Find("BackGround1"); resetScript = backGround.GetComponent <ScrollReset>(); canvas = GameObject.Find("Canvas"); scoreScript = canvas.GetComponent <Score>(); spawnTime = Random.Range(0.5f, 3f); treeHealth = Random.Range(4, 7); }