private void SelectMaskAnimation() { // Hide any previous mask SetMaskEnabled(false); this.mapMaskSprites.Clear(); // Different sets of masks and animations exist. For instance, zoom in/out from // the centre, pan down, pan right. int numSets = this.mapMaskSets.Length; int setNum = UnityEngine.Random.Range(0, numSets); GameObject set = this.mapMaskSets[setNum]; this.mapMaskSet = set; // Recolor the sprites and put them in a list to trigger their animations. LevelTheme theme = this.gameManager.Theme; UISprite[] maskSprites = set.GetComponentsInChildren <UISprite>(true); foreach (UISprite mask in maskSprites) { mask.color = theme.BackgroundColour; this.mapMaskSprites.Add(mask); TweenColor colourTween = mask.GetComponent <TweenColor>(); if (colourTween != null) { colourTween.Recolour(theme.BackgroundColour); } } // Set the new mask to be displayed SetMaskEnabled(true); }