Candy Match 3 Kit Manual

From gamevanilla wiki
Revision as of 04:30, 3 November 2018 by David (Talk | contribs) (How can I re-skin the in-game candies?)

Jump to: navigation, search


How can I add a background music?

We use a background music in the demo but we are not allowed to redistribute it, so you need to do it manually yourself. You can find the download link in the Credits.pdf file located inside the Sounds folder. Once you have downloaded the music and imported it into your project (remember to set its Load Type as Streaming, which is the recommended setting for background music), you just need to drag it into the Audio Source component of the BackgroundMusic object located in the home scene.

How can I add a new level to the map?

The level map contains a scrollable list of buttons that are used to enter the levels (in the scene's hierarchy, you can find the list in Canvas/LevelMap/ScrollView. These buttons are instances of the LevelMapButton prefab, which has a Num Level property that indicates the level number:


You will need to have created the corresponding level with that number via the level editor.

How can I customize the game's popups?

All the popups in the game are prefabs located in the Resources/Popups folder that are dynamically spawned via script as appropriate during the game and have an associated independent script that contains their specific logic. In order to modify them, you can drag them into the Canvas object of a scene (as a child) and apply your custom changes to them as you normally do with prefabs in Unity.

These are all the popups in the game:

  • AlertPopup: generic alert dialog used to show information or errors.
  • BoosterAwardPopup: shown when the game ends and the player has additional moves or time left.
  • BuyBoostersPopup: in-game booster shop.
  • BuyCoinsPopup: coins shop.
  • BuyLivesPopup: lives shop.
  • ExitGamePopup: dialog that allows the player to exit a game.
  • InGameSettingsPopup: in-game pause popup that allows the player to change the audio settings and exit the game.
  • LevelGoalsPopup: shown right before a game begins in order to let the player know what are the goals of the level.
  • LoadingPopup: generic loading popup.
  • LosePopup: shown when the player loses a game.
  • NoMovesOrTimePopup: shown when a game is finished because the player has no moves or time left.
  • RegenLevelPopup: loading popup shown while a level is regenerating (it happens when there are no more possible moves).
  • SettingsPopup: the settings popup located in the home scene.
  • StartGamePopup: shown when a player clicks on a level button in the level scene.
  • WinPopup: shown when the player wins a game.

How can I re-skin the in-game candies?

All the in-game candies are prefabs located in the Prefabs folder of the project, so you just need to change the sprite in the corresponding prefab. Also, please make sure that:

  • The size of the new sprites is the same as the original ones.
  • The Pixel Per Unit setting of the new sprites is set to the same value as the original ones.

How can I make the tiles falling from the sky to be only visible inside the level bounds?

You can do it by using sprite masks in the background tiles. In order to do so, follow these steps:

  • Add a SpriteMask component to the LightBgTile and DarkBgTile prefabs located in the Prefabs folder (make sure to set their sprites to TileLight and TileDark respectively).
  • Modify the GameBoard class located in the Scripts/Game/Common folder by adding these lines at the end of the ApplyGravityInternal method:
if (tiles[tileIndex] == null && !isHole)
    var tile = CreateTile(i, j, true);
    tile.GetComponent<SpriteRenderer>().maskInteraction = SpriteMaskInteraction.VisibleInsideMask;
    // ...
    tween.setOnComplete(() =>
        if (tile.activeSelf && tile.GetComponent<Animator>() != null)
            tile.GetComponent<SpriteRenderer>().maskInteraction = SpriteMaskInteraction.None;
    tiles[tileIndex] = tile;

Note the two new lines that have been added to the original code that set the mask interaction of the falling candies. This will mask the candies that fall from the sky, but not the ones that fall over a blank tile on the level. If you want to always mask the candies (even inside the blank lines of a level) instead, just do not add the two aforementioned lines of code to the GameBoard class and, for every candy prefab, set the 'Mask Interaction' field in the Sprite Renderer component to 'Visible Inside Mask'.