C# Class PuzzleManager, RoverGame

Inheritance: MonoBehaviour
Show file Open project: Stumpstump/RoverGame Class Usage Examples

Public Properties

Property Type Description
Moves int
backButtonImage Image,
beginDrawEffect UnityEngine.AudioClip
beginGridCell GridCell,
beginWireCount int
beginWireCounter Transform
beginWireIngredient Ingredient,
cachedSoundSource SoundSource,
cellCompleteColor Color
cellContentPrefab GameObject
cellStartColor Color
cellTransColor Color
clickMoving bool
connectedSFX UnityEngine.AudioClip
contentCellPrefab GameObject
currentGridCell GridCell,
currentLevel Level,
currentLine Line,
currentRayCell Transform
draggingElement GameObject
draggingElementPrefab GameObject
draggingElementSpriteRenderer SpriteRenderer
drawDraggingElement bool
drawShortedEffect AudioClip
grid GameObject
gridBottomPivotTransform Transform
gridCellPrefab GameObject
gridCells GridCell[]
gridContentsTransform Transform
gridLinePrefab GameObject
gridLines Line[]
gridLinesTransfrom Transform
gridSize Vector2
gridTopPivotTransform Transform
hits RaycastHit[]
isRunning bool
levelLockedSFX AudioClip
levelText Text
lineDrawEffect AudioClip
mainCamera Camera
missionText Text
movements int
nextButtonImage Image
numberOfColumns int
numberOfRows int
pairCell GridCell
pairHoverEffect AudioClip
pairSparks GameObject
playerRay Ray
previousGridCell GridCell
previousRayCell Transform
pulsateColor Color
pulsateDelay float
pulsateGrid bool
pulseGridTime float
puzzleCompleteEffect AudioClip
rayCellChange bool
resetLineEffect AudioClip
tempCollider2D Collider2D
tempCollider3D Collider
tempColor Color
tempPoint Vector3
tempScale Vector3
tempSpriteRendererd Image
timer Timer
waterBubbleSFX AudioClip
wirePairCounter GameObject
worldLinePrefab GameObject

Public Methods

Method Description
Awake ( ) : void
Close ( ) : void
EnoughWiresOfType ( ) : bool
InitializePuzzle ( GameObject puzzle_Canvas ) : void

When the GameObject becomes visible

NextLevel ( ) : void

Go to the next level.

OnDisable ( ) : void

When the GameObject becomes invisible.

PreviousLevel ( ) : void

Back to the previous level.

PulsateWait ( ) : IEnumerator
RefreshGrid ( ) : void

Refreshs(Reset) the grid.

RunPuzzle ( ) : void
Update ( ) : void

Private Methods

Method Description
BuildTheGrid ( ) : void

Build the grid.

CheckForPair ( RaycastHit hitter ) : bool
CheckLevelComplete ( ) : void

Checks Wheter the level is completed.

Cleanup ( bool completed ) : void
CreateDraggingElement ( Color color, Vector3 scale ) : void

Creates the dragging element.

CreateGridLine ( float lineWidth, Color lineColor, string name, int index ) : void

Setting up Grid Lines

CreateNewLevel ( ) : void

Create a new level.

CreateWireLine ( Color lineColor, string name, int index ) : void
DelayRun ( ) : IEnumerator
DrawDraggingElement ( Vector3 clickPosition ) : void

Draw(Drag) the dragging element.

GridCellClickBegan ( ) : void

When a click(touch) began on the GridCell.

GridCellClickMoved ( ) : void

When a click(touch) moved over the GridCell.

IncreaseMovements ( ) : void

Increase the movements counter.

PulsateGrid ( ) : void
RayCast ( ClickType clickType ) : void

Raycast the click (touch) on the screen.

Release ( Line, line ) : void

On Click Release event.

RemoveInventoryWires ( ) : void
ResetGameContents ( ) : void

Resets the game contents.

SetEndMoves ( ) : void
SetGridPairIngredient ( GridCell, cell, Level, wireType ) : void
SettingUpNextBackAlpha ( ) : void

Setting up alpha value for the next and back buttons.

SettingUpObstacles ( ) : void
SettingUpPairs ( ) : void

Setting up the cells pairs.

Method Details

Awake() public method

public Awake ( ) : void
return void

Close() public method

public Close ( ) : void
return void

EnoughWiresOfType() public method

public EnoughWiresOfType ( ) : bool
return bool

InitializePuzzle() public method

When the GameObject becomes visible
public InitializePuzzle ( GameObject puzzle_Canvas ) : void
puzzle_Canvas GameObject
return void

NextLevel() public method

Go to the next level.
public NextLevel ( ) : void
return void

OnDisable() public method

When the GameObject becomes invisible.
public OnDisable ( ) : void
return void

PreviousLevel() public method

Back to the previous level.
public PreviousLevel ( ) : void
return void

PulsateWait() public method

public PulsateWait ( ) : IEnumerator
return IEnumerator

RefreshGrid() public method

Refreshs(Reset) the grid.
public RefreshGrid ( ) : void
return void

RunPuzzle() public method

public RunPuzzle ( ) : void
return void

Update() public method

public Update ( ) : void
return void

Property Details

Moves public property

public int Moves
return int

backButtonImage public property

The back button image.
public Image, backButtonImage
return Image,

beginDrawEffect public property

public AudioClip,UnityEngine beginDrawEffect
return UnityEngine.AudioClip

beginGridCell public property

public GridCell, beginGridCell
return GridCell,

beginWireCount public property

public int beginWireCount
return int

beginWireCounter public property

public Transform beginWireCounter
return Transform

beginWireIngredient public property

public Ingredient, beginWireIngredient
return Ingredient,

cachedSoundSource public property

public SoundSource, cachedSoundSource
return SoundSource,

cellCompleteColor public property

public Color cellCompleteColor
return Color

cellContentPrefab public property

The cell content prefab.
public GameObject cellContentPrefab
return GameObject

cellStartColor public property

public Color cellStartColor
return Color

cellTransColor public property

public Color cellTransColor
return Color

clickMoving public property

Whether the current click is moving
public bool clickMoving
return bool

connectedSFX public property

The connected sound effect.
public AudioClip,UnityEngine connectedSFX
return UnityEngine.AudioClip

contentCellPrefab public property

public GameObject contentCellPrefab
return GameObject

currentGridCell public property

The current(selected) grid cell.
public GridCell, currentGridCell
return GridCell,

currentLevel public static property

The current level.
public static Level, currentLevel
return Level,

currentLine public property

current line in the grid.
public Line, currentLine
return Line,

currentRayCell public property

public Transform currentRayCell
return Transform

draggingElement public property

The dragging element reference.
public GameObject draggingElement
return GameObject

draggingElementPrefab public property

The dragging element prefab.
public GameObject draggingElementPrefab
return GameObject

draggingElementSpriteRenderer public property

The dragging element sprite renderer.
public SpriteRenderer draggingElementSpriteRenderer
return SpriteRenderer

drawDraggingElement public property

Whether the dragging element is rendering(dragging)
public bool drawDraggingElement
return bool

drawShortedEffect public property

public AudioClip drawShortedEffect
return AudioClip

grid public property

The grid.
public GameObject grid
return GameObject

gridBottomPivotTransform public property

The grid bottom pivot transform.
public Transform gridBottomPivotTransform
return Transform

gridCellPrefab public property

The grid cell prefab.
public GameObject gridCellPrefab
return GameObject

gridCells public static property

The grid cells in the grid.
public static GridCell[] gridCells
return GridCell[]

gridContentsTransform public property

The grid contents transform.
public Transform gridContentsTransform
return Transform

gridLinePrefab public property

The grid line prefab.
public GameObject gridLinePrefab
return GameObject

gridLines public static property

The grid lines in the grid.
public static Line[] gridLines
return Line[]

gridLinesTransfrom public property

The grid lines transfrom.
public Transform gridLinesTransfrom
return Transform

gridSize public property

The size of the grid.
public Vector2 gridSize
return Vector2

gridTopPivotTransform public property

The grid top pivot transform.
public Transform gridTopPivotTransform
return Transform

hits public property

public RaycastHit[] hits
return RaycastHit[]

isRunning public property

Whether the GameManager is running.
public bool isRunning
return bool

levelLockedSFX public property

The level locked sound effect.
public AudioClip levelLockedSFX
return AudioClip

levelText public property

The level text.
public Text levelText
return Text

lineDrawEffect public property

public AudioClip lineDrawEffect
return AudioClip

mainCamera public property

public Camera mainCamera
return Camera

missionText public property

The mission text.
public Text missionText
return Text

movements public static property

The movements counter.
public static int movements
return int

nextButtonImage public property

The next button image.
public Image nextButtonImage
return Image

numberOfColumns public static property

The number of columns of the grid.
public static int numberOfColumns
return int

numberOfRows public static property

The number of rows of the grid.
public static int numberOfRows
return int

pairCell public property

public GridCell pairCell
return GridCell

pairHoverEffect public property

public AudioClip pairHoverEffect
return AudioClip

pairSparks public property

public GameObject pairSparks
return GameObject

playerRay public property

public Ray playerRay
return Ray

previousGridCell public property

The previous grid cell.
public GridCell previousGridCell
return GridCell

previousRayCell public property

public Transform previousRayCell
return Transform

pulsateColor public property

public Color pulsateColor
return Color

pulsateDelay public property

public float pulsateDelay
return float

pulsateGrid public property

public bool pulsateGrid
return bool

pulseGridTime public property

public float pulseGridTime
return float

puzzleCompleteEffect public property

public AudioClip puzzleCompleteEffect
return AudioClip

rayCellChange public property

public bool rayCellChange
return bool

resetLineEffect public property

public AudioClip resetLineEffect
return AudioClip

tempCollider2D public property

Temp collider 2d.
public Collider2D tempCollider2D
return Collider2D

tempCollider3D public property

Temp collider 2d.
public Collider tempCollider3D
return Collider

tempColor public property

Temp color.
public Color tempColor
return Color

tempPoint public property

Temp point.
public Vector3 tempPoint
return Vector3

tempScale public property

Temp scale.
public Vector3 tempScale
return Vector3

tempSpriteRendererd public property

Temporary sprite renderer.
public Image tempSpriteRendererd
return Image

timer public property

The timer reference.
public Timer timer
return Timer

waterBubbleSFX public property

The water bubble sound effect.
public AudioClip waterBubbleSFX
return AudioClip

wirePairCounter public property

public GameObject wirePairCounter
return GameObject

worldLinePrefab public property

public GameObject worldLinePrefab
return GameObject