C# Class MinigamePexeso.GameScript

Inheritance: UnityEngine.MonoBehaviour
Exibir arquivo Open project: BrainProject/UnityTemp

Public Properties

Property Type Description
columns int
correctPairsDisplay UnityEngine.GUIText
currentGame GameType
customPack System.Boolean
enableSound bool
gameTilePrefab UnityEngine.GameObject
menu UnityEngine.GameObject
resourcePack string
resourcePackMenu UnityEngine.GameObject
rows int
scoreb UnityEngine.GameObject
timerDisplay UnityEngine.GUIText
wrongPairsDisplay UnityEngine.GUIText

Public Methods

Method Description
AddCustomPicturesToGameTiles ( ) : IEnumerator

Randomly assigns pictures from custom resource pack to game tiles.

AddPicturesToGameTiles ( ) : void

Randomly assigns pictures to game tiles.

CreateGameBoard ( ) : void

Initialization. Creates all cubes and planes, sets their position etc.

FoundPairPexeso ( GameObject first, GameObject second ) : IEnumerator

COROUTINE. Called when user selected two matching pictures

FoundPairSilhouette ( GameObject first, GameObject second ) : IEnumerator

COROUTINE. Called when user selected two pictures which match.

NotFoundPairPexeso ( GameObject first, GameObject second ) : IEnumerator

COROUTINE. Called when user selected two tiles which different pictures

NotFoundPairSilhouette ( GameObject first, GameObject second ) : IEnumerator

COROUTINE. Called when user selected two pictures which do not match.

RestartGame ( ) : IEnumerator

Restarts the game.

Update ( ) : void

Infinite loop. Updates game time and launches specific game turn.

checkTilesMatch ( GameObject first, GameObject second ) : bool

Returns true if pictures of given tiles are matching.

Private Methods

Method Description
EndGame ( ) : void

Game ended. Play winning music, stop timer, etc.

PexesoGameTurn ( ) : void

Game turn of Pexeso. Calculates clicking on tiles, matching of pairs, starting game tile flip and remove coroutines.

SilhouetteGameTurn ( ) : void

Game turn of Silhouette or Similarities. Calculates clicking on tiles, matching of pairs, starting game tile move and remove coroutines.

Method Details

AddCustomPicturesToGameTiles() public method

Randomly assigns pictures from custom resource pack to game tiles.
public AddCustomPicturesToGameTiles ( ) : IEnumerator
return IEnumerator

AddPicturesToGameTiles() public method

Randomly assigns pictures to game tiles.
public AddPicturesToGameTiles ( ) : void
return void

CreateGameBoard() public method

Initialization. Creates all cubes and planes, sets their position etc.
public CreateGameBoard ( ) : void
return void

FoundPairPexeso() public method

COROUTINE. Called when user selected two matching pictures
public FoundPairPexeso ( GameObject first, GameObject second ) : IEnumerator
first UnityEngine.GameObject First object
second UnityEngine.GameObject Second object
return IEnumerator

FoundPairSilhouette() public method

COROUTINE. Called when user selected two pictures which match.
public FoundPairSilhouette ( GameObject first, GameObject second ) : IEnumerator
first UnityEngine.GameObject First object
second UnityEngine.GameObject Second object
return IEnumerator

NotFoundPairPexeso() public method

COROUTINE. Called when user selected two tiles which different pictures
public NotFoundPairPexeso ( GameObject first, GameObject second ) : IEnumerator
first UnityEngine.GameObject First game tile
second UnityEngine.GameObject Second game tile
return IEnumerator

NotFoundPairSilhouette() public method

COROUTINE. Called when user selected two pictures which do not match.
public NotFoundPairSilhouette ( GameObject first, GameObject second ) : IEnumerator
first UnityEngine.GameObject First object
second UnityEngine.GameObject Second object
return IEnumerator

RestartGame() public method

Restarts the game.
public RestartGame ( ) : IEnumerator
return IEnumerator

Update() public method

Infinite loop. Updates game time and launches specific game turn.
public Update ( ) : void
return void

checkTilesMatch() public method

Returns true if pictures of given tiles are matching.
public checkTilesMatch ( GameObject first, GameObject second ) : bool
first UnityEngine.GameObject
second UnityEngine.GameObject
return bool

Property Details

columns public_oe property

Number of columns.
public int columns
return int

correctPairsDisplay public_oe property

GUI Number of correct pairs. Used as score.
public GUIText,UnityEngine correctPairsDisplay
return UnityEngine.GUIText

currentGame public_oe property

Current game type.
public GameType currentGame
return GameType

customPack public_oe property

True if custom resource pack is selected.
public Boolean,System customPack
return System.Boolean

enableSound public_oe property

True if sounds are enabled.
public bool enableSound
return bool

gameTilePrefab public_oe property

Game tile.
public GameObject,UnityEngine gameTilePrefab
return UnityEngine.GameObject

menu public_oe property

GameStart script
public GameObject,UnityEngine menu
return UnityEngine.GameObject

resourcePack public_oe property

Determines current resource pack
public string resourcePack
return string

resourcePackMenu public_oe property

ResourcePack script
public GameObject,UnityEngine resourcePackMenu
return UnityEngine.GameObject

rows public_oe property

Number of rows.
public int rows
return int

scoreb public_oe property

Scoreboard. Not used at the moment
public GameObject,UnityEngine scoreb
return UnityEngine.GameObject

timerDisplay public_oe property

GUIText for timer.
public GUIText,UnityEngine timerDisplay
return UnityEngine.GUIText

wrongPairsDisplay public_oe property

GUI Number of wrong pairs. Used as score.
public GUIText,UnityEngine wrongPairsDisplay
return UnityEngine.GUIText