BackgroundScroller.initialiseBackgroundList C# (CSharp) Method

initialiseBackgroundList() private method

private initialiseBackgroundList ( ) : void
return void
	private void initialiseBackgroundList () {

		// Change the sprites if a non-standard theme has been set - not a big fan of how this operates differently to the item scripts
		reskin ();

		// Add everything from ground to the beginning of space
		backgroundList.AddRange (loopArray (clouds, cloudsRepetitions));
		backgroundList.AddRange (new List<Sprite> () {dayTransition, nightTransition, night, moon, night, spaceTransition});

		Sprite[] celestObjs = {mars, asteroidBelt, jupiter, saturn, uranus, neptune, kuiperBelt};

		// Add the planets & other space stuff with space backgrounds in between
		foreach (Sprite cObj in celestObjs) {
			backgroundList.AddRange (loopArray (space, spaceRepetitions));
			backgroundList.Add(cObj);
		}

		// Take alternate backgrounds based on which of the 2 gameobjects this is attached to
		if (gameObject.tag == Tags.TAG_BACKGROUND_ONE) {
			backgroundList = backgroundList.Where ((s, i) => i%2 ==  0).ToList();
		} else {
			backgroundList = backgroundList.Where ((s, i) => i%2 ==  1).ToList();
		}

	}