// Start is called before the first frame update void Start() { playerrb = GetComponent <Rigidbody2D>(); bg = GameObject.Find("Background").GetComponent <RepeatBg>(); ps = GameObject.Find("PipeSpawn").GetComponent <PipeSpawn>(); hitsound = GetComponent <AudioSource>(); animator = GetComponent <Animator>(); }
public override void OnGenerationEndMulti() { base.OnGenerationEndMulti(); transform.position = startpos; timer = 0; PipeScript[] pipes = FindObjectsOfType <PipeScript>(); foreach (PipeScript p in pipes) { Destroy(p.gameObject); } PipeSpawn spawn = FindObjectOfType <PipeSpawn>(); spawn.timer = spawn.timeBetweenPipes; body.Sleep(); }